<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>4 Configuration 2.2.1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
    <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
    <script type="text/javascript">
function addJsClass() {
    var classes = document.body.className.split(" ");
    classes.push("js");
    document.body.className = classes.join(" ");
}
    </script>
</head>

<body class="body" onload="addJsClass();">
<div id="navigation">
    <ul>
        <li>
            <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
                <a href="../guide/index.html" class="button">Table of contents</a>

                <div id="nav-summary-childs" style="display:none;">
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/gettingStarted.html"><strong>2</strong><span>Getting Started</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/upgradingFromPreviousVersionsOfGrails.html"><strong>3</strong><span>Upgrading from previous versions of Grails</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/conf.html"><strong>4</strong><span>Configuration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/commandLine.html"><strong>5</strong><span>The Command Line</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/GORM.html"><strong>6</strong><span>Object Relational Mapping (GORM)</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/theWebLayer.html"><strong>7</strong><span>The Web Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/validation.html"><strong>8</strong><span>Validation</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/services.html"><strong>9</strong><span>The Service Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/testing.html"><strong>10</strong><span>Testing</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/i18n.html"><strong>11</strong><span>Internationalization</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/security.html"><strong>12</strong><span>Security</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/plugins.html"><strong>13</strong><span>Plugins</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/webServices.html"><strong>14</strong><span>Web Services</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/spring.html"><strong>15</strong><span>Grails and Spring</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/hibernate.html"><strong>16</strong><span>Grails and Hibernate</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/scaffolding.html"><strong>17</strong><span>Scaffolding</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/deployment.html"><strong>18</strong><span>Deployment</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../guide/contributing.html"><strong>19</strong><span>Contributing to Grails</span></a>
                    </div>
                    
                </div>
            </div>
        </li>
        <li class="separator selected">
            <a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
        </li>
    </ul>
</div>
<div id="header">
    <div class="images clearfix">
        
        <span id="logo"><a href="http://grails.org" target="_blank"><img alt="Grails Logo" title="The Grails Framework" src="../img/grails.png" border="0"/></a></span>
        
        
        <span id="sponsor"><a href="http://springsource.com" target="_blank"><img alt="SpringSource Logo" title="SpringSource - Weapons for the War on Java Complexity" src="../img/springsource-logo.png" border="0"/></a></span>
        
    </div>
    <p>See the light - agile, industrial strength, rapid web application development made easy</p>
</div>


<table id="colset" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td id="col1">
            <div id="main" class="corner-all">

                
                    <div class="toc-item prev-left"><a href="../guide/upgradingFromPreviousVersionsOfGrails.html">&lt;&lt; <strong>3</strong><span>Upgrading from previous versions of Grails</span></a></div>
                

                <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>

                
                    <div class="toc-item next-right"><a href="../guide/commandLine.html"><strong>5</strong><span>The Command Line</span> >></a></div>
                


                <div class="project">
                    <h1>4 Configuration - Reference Documentation</h1>

                    <p><strong>Authors:</strong> Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith</p>

                    <p><strong>Version:</strong> 2.2.1</p>

                    
                </div>

                
                <div id="table-of-content">
                    <h2>Table of Contents</h2>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#config"><strong>4.1</strong><span>Basic Configuration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#builtInOptions"><strong>4.1.1</strong><span>Built in options</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#logging"><strong>4.1.2</strong><span>Logging</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#configGORM"><strong>4.1.3</strong><span>GORM</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#environments"><strong>4.2</strong><span>Environments</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#dataSource"><strong>4.3</strong><span>The DataSource</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#dataSourcesAndEnvironments"><strong>4.3.1</strong><span>DataSources and Environments</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#JNDIDataSources"><strong>4.3.2</strong><span>JNDI DataSources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#automaticDatabaseMigration"><strong>4.3.3</strong><span>Automatic Database Migration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#transactionAwareDataSourceProxy"><strong>4.3.4</strong><span>Transaction-aware DataSource Proxy</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#databaseConsole"><strong>4.3.5</strong><span>Database Console</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#multipleDatasources"><strong>4.3.6</strong><span>Multiple Datasources</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#configExternalized"><strong>4.4</strong><span>Externalized Configuration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#versioning"><strong>4.5</strong><span>Versioning</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#docengine"><strong>4.6</strong><span>Project Documentation</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0px"><a href="#ivy"><strong>4.7</strong><span>Dependency Resolution</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#configurationsAndDependencies"><strong>4.7.1</strong><span>Configurations and Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#dependencyRepositories"><strong>4.7.2</strong><span>Dependency Repositories</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#debuggingResolution"><strong>4.7.3</strong><span>Debugging Resolution</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#inheritedDependencies"><strong>4.7.4</strong><span>Inherited Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#providingDefaultDependencies"><strong>4.7.5</strong><span>Providing Default Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#changingDependencies"><strong>4.7.6</strong><span>Snapshots and Other Changing Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#dependencyReports"><strong>4.7.7</strong><span>Dependency Reports</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#pluginJARDependencies"><strong>4.7.8</strong><span>Plugin JAR Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#mavenIntegration"><strong>4.7.9</strong><span>Maven Integration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#mavendeploy"><strong>4.7.10</strong><span>Deploying to a Maven Repository</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#pluginDependencies"><strong>4.7.11</strong><span>Plugin Dependencies</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:10px"><a href="#dependencyResolutionCaching"><strong>4.7.12</strong><span>Caching of Dependency Resolution Results</span></a>
                    </div>
                    
                </div>
                

                
<a name="3. Configuration"><!-- Legacy link --></a>
<h1 id="conf">4 Configuration</h1>
It may seem odd that in a framework that embraces "convention-over-configuration" that we tackle this topic now. With Grails' default settings you can actually develop an application without doing any configuration whatsoever, as the quick start demonstrates, but it's important to learn where and how to override the conventions when you need to. Later sections of the user guide will mention what configuration settings you can use, but not how to set them. The assumption is that you have at least read the first section of this chapter!


<a name="3.1 Basic Configuration"><!-- Legacy link --></a>
<h2 id="config">4.1 Basic Configuration</h2>
For general configuration Grails provides two files:
<ul class="star">
<li><code>grails-app/conf/BuildConfig.groovy</code></li>
<li><code>grails-app/conf/Config.groovy</code></li>
</ul><p class="paragraph"/>Both of them use Groovy's <a href="http://groovy.codehaus.org/ConfigSlurper" target="blank">ConfigSlurper</a> syntax. The first, <code>BuildConfig.groovy</code>, is for settings that are used when running Grails commands, such as <code>compile</code>, <code>doc</code>, etc. The second file, <code>Config.groovy</code>, is for settings that are used when your application is running. This means that <code>Config.groovy</code> is packaged with your application, but <code>BuildConfig.groovy</code> is not. Don't worry if you're not clear on the distinction: the guide will tell you which file to put a particular setting in.<p class="paragraph"/>The most basic syntax is similar to that of Java properties files with dot notation on the left-hand side:<p class="paragraph"/><div class="code"><pre>foo.bar.hello = <span class="java&#45;quote">"world"</span></pre></div><p class="paragraph"/>Note that the value is a Groovy string literal! Those quotes around 'world' are important. In fact, this highlights one of the advantages of the ConfigSlurper syntax over properties files: the property values can be any valid Groovy type, such as strings, integers, or arbitrary objects!<p class="paragraph"/>Things become more interesting when you have multiple settings with the same base. For example, you could have the two settings<p class="paragraph"/><div class="code"><pre>foo.bar.hello = <span class="java&#45;quote">"world"</span>
foo.bar.good = <span class="java&#45;quote">"bye"</span></pre></div><p class="paragraph"/>both of which have the same base: <code>foo.bar</code>. The above syntax works but it's quite repetitive and verbose. You can remove some of that verbosity by nesting properties at the dots:<p class="paragraph"/><div class="code"><pre>foo &#123;
    bar &#123;
        hello = <span class="java&#45;quote">"world"</span>
        good = <span class="java&#45;quote">"bye"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>or by only partially nesting them:<p class="paragraph"/><div class="code"><pre>foo &#123;
    bar.hello = <span class="java&#45;quote">"world"</span>
    bar.good = <span class="java&#45;quote">"bye"</span>
&#125;</pre></div><p class="paragraph"/>However, you can't nest after using the dot notation. In other words, this <strong class="bold">won't</strong> work:<p class="paragraph"/><div class="code"><pre>// Won't work!
foo.bar &#123;
    hello = <span class="java&#45;quote">"world"</span>
    good = <span class="java&#45;quote">"bye"</span>
&#125;</pre></div><p class="paragraph"/>Within both <code>BuildConfig.groovy</code> and <code>Config.groovy</code> you can access several implicit variables from configuration values:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Variable</strong></th><th><strong class="bold">Description</strong></th></tr><tr class="table-odd"><td>userHome</td><td>Location of the home directory for the account that is running the Grails application.</td></tr><tr class="table-even"><td>grailsHome</td><td>Location of the home directory for the account that is running the Grails application.</td></tr><tr class="table-odd"><td>appName</td><td>The application name as it appears in application.properties.</td></tr><tr class="table-even"><td>appVersion</td><td>The application version as it appears in application.properties.</td></tr></table><p class="paragraph"/>For example:<p class="paragraph"/><div class="code"><pre>my.tmp.dir = <span class="java&#45;quote">"&#36;&#123;userHome&#125;/.grails/tmp"</span></pre></div><p class="paragraph"/>In addition, <code>BuildConfig.groovy</code> has<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Variable</strong></th><th><strong class="bold">Description</strong></th></tr><tr class="table-odd"><td>grailsVersion</td><td>The version of Grails used to build the project.</td></tr><tr class="table-even"><td>grailsSettings</td><td>An object containing various build related settings, such as <code>baseDir</code>. It's of type <a href="../api/grails/util/BuildSettings.html" class="api"><code>BuildSettings</code></a>.</td></tr></table><p class="paragraph"/>and <code>Config.groovy</code> has<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Variable</strong></th><th><strong class="bold">Description</strong></th></tr><tr class="table-odd"><td>grailsApplication</td><td>The <a href="../api/org/codehaus/groovy/grails/commons/GrailsApplication.html" class="api"><code>GrailsApplication</code></a> instance.</td></tr></table><p class="paragraph"/>Those are the basics of adding settings to the configuration file, but how do you access those settings from your own application? That depends on which config you want to read.<p class="paragraph"/>The settings in <code>BuildConfig.groovy</code> are only available from <a href="../guide/single.html#creatingGantScripts" class="guide">command scripts</a> and can be accessed via the <code>grailsSettings.config</code> property like so:<p class="paragraph"/><div class="code"><pre>target(<span class="java&#45;keyword">default</span>: <span class="java&#45;quote">"Example command"</span>) &#123;
    def maxIterations = grailsSettings.config.myapp.iterations.max
    &#8230;
&#125;</pre></div><p class="paragraph"/>If you want to read runtime configuration settings, i.e. those defined in <code>Config.groovy</code>, use the <a href="../api/org/codehaus/groovy/grails/commons/GrailsApplication.html" class="api"><code>grailsApplication</code></a> object, which is available as a variable in controllers and tag libraries:<p class="paragraph"/><div class="code"><pre>class MyController &#123;
    def hello() &#123;
        def recipient = grailsApplication.config.foo.bar.hello<p class="paragraph"/>        render <span class="java&#45;quote">"Hello $&#123;recipient&#125;"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>and can be easily injected into services and other Grails artifacts:<p class="paragraph"/><div class="code"><pre>class MyService &#123;
    def grailsApplication<p class="paragraph"/>    <span class="java&#45;object">String</span> greeting() &#123;
        def recipient = grailsApplication.config.foo.bar.hello
        <span class="java&#45;keyword">return</span> <span class="java&#45;quote">"Hello $&#123;recipient&#125;"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>As you can see, when accessing configuration settings you use the same dot notation as when you define them.


<a name="3.1.1 Built in options"><!-- Legacy link --></a>
<h2 id="builtInOptions">4.1.1 Built in options</h2>
Grails has a set of core settings that are worth knowing about. Their defaults are suitable for most projects, but it's important to understand what they do because you may need one or more of them later.<p class="paragraph"/><h3>Build settings</h3><p class="paragraph"/>Let's start with some important build settings. Although Grails requires JDK 6 when developing your applications, it is possible to deploy those applications to JDK 5 containers. Simply set the following in <code>BuildConfig.groovy</code>:<p class="paragraph"/><div class="code"><pre>grails.project.source.level = <span class="java&#45;quote">"1.5"</span>
grails.project.target.level = <span class="java&#45;quote">"1.5"</span></pre></div><p class="paragraph"/>Note that source and target levels are different to the standard public version of JDKs, so JDK 5 -&#62; 1.5, JDK 6 -&#62; 1.6, and JDK 7 -&#62; 1.7.<p class="paragraph"/>In addition, Grails supports Servlet versions 2.5 and above but defaults to 2.5. If you wish to use newer features of the Servlet API (such as 3.0 async support) you should configure the <code>grails.servlet.version</code> setting appropriately:<p class="paragraph"/><div class="code"><pre>grails.servlet.version = <span class="java&#45;quote">"3.0"</span></pre></div><p class="paragraph"/><h3>Runtime settings</h3><p class="paragraph"/>On the runtime front, i.e. <code>Config.groovy</code>, there are quite a few more core settings:
<ul class="star">
<li><code>grails.config.locations</code>  - The location of properties files or addition Grails Config files that should be merged with main configuration. See the <a href="../guide/single.html#configExternalized" class="guide">section on externalised config</a>.</li>
<li><code>grails.enable.native2ascii</code> - Set this to false if you do not require native2ascii conversion of Grails i18n properties files (default: true).</li>
<li><code>grails.views.default.codec</code> - Sets the default encoding regime for GSPs - can be one of 'none', 'html', or 'base64' (default: 'none'). To reduce risk of XSS attacks, set this to 'html'.</li>
<li><code>grails.views.gsp.encoding</code> - The file encoding used for GSP source files (default: 'utf-8').</li>
<li><code>grails.mime.file.extensions</code> - Whether to use the file extension to dictate the mime type in <a href="../guide/single.html#contentNegotiation" class="guide">Content Negotiation</a> (default: true).</li>
<li><code>grails.mime.types</code> - A map of supported mime types used for <a href="../guide/single.html#contentNegotiation" class="guide">Content Negotiation</a>.</li>
<li><code>grails.serverURL</code> - A string specifying the server URL portion of absolute links, including server name e.g. grails.serverURL="http://my.yourportal.com". See <a href="../ref/Tags/createLink.html" class="Tags">createLink</a>. Also used by redirects.</li>
<li><code>grails.views.gsp.sitemesh.preprocess</code> - Determines whether SiteMesh preprocessing happens. Disabling this slows down page rendering, but if you need SiteMesh to parse the generated HTML from a GSP view then disabling it is the right option. Don't worry if you don't understand this advanced property: leave it set to true.</li>
<li><code>grails.reload.excludes</code> and <code>grails.reload.includes</code> - Configuring these directives determines the reload behavior for project specific source files. Each directive takes a list of strings that are the class names for project source files that should be excluded from reloading behavior or included accordingly when running the application in development with the <code>run-app</code> command. If the <code>grails.reload.includes</code> directive is configured, then only the classes in that list will be reloaded.</li>
</ul><p class="paragraph"/><h3>War generation</h3>
<ul class="star">
<li><code>grails.project.war.file</code> - Sets the name and location of the WAR file generated by the <a href="../ref/Command Line/war.html" class="commandLine">war</a> command</li>
<li><code>grails.war.dependencies</code> - A closure containing Ant builder syntax or a list of JAR filenames. Lets you customise what libaries are included in the WAR file.</li>
<li><code>grails.war.copyToWebApp</code> - A closure containing Ant builder syntax that is legal inside an Ant copy, for example "fileset()". Lets you control what gets included in the WAR file from the "web-app" directory.</li>
<li><code>grails.war.resources</code> - A closure containing Ant builder syntax. Allows the application to do any other other work before building the final WAR file</li>
</ul><p class="paragraph"/>For more information on using these options, see the section on <a href="../guide/single.html#deployment" class="guide">deployment</a>


<a name="3.1.2 Logging"><!-- Legacy link --></a>
<h2 id="logging">4.1.2 Logging</h2>
<h3>The Basics</h3><p class="paragraph"/>Grails uses its common configuration mechanism to provide the settings for the underlying <a href="http://logging.apache.org/log4j/1.2/index.html" target="blank">Log4j</a> log system, so all you have to do is add a <code>log4j</code> setting to the file <code>grails-app/conf/Config.groovy</code>.<p class="paragraph"/>So what does this <code>log4j</code> setting look like? Here's a basic example:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
           'org.codehaus.groovy.grails.web.pages' //  GSP<p class="paragraph"/>    warn   'org.apache.catalina'
&#125;</pre></div><p class="paragraph"/>This says that for loggers whose name starts with 'org.codehaus.groovy.grails.web.servlet' or 'org.codehaus.groovy.grails.web.pages', only messages logged at 'error' level and above will be shown. Loggers with names starting with 'org.apache.catalina' logger only show messages at the 'warn' level and above. What does that mean? First of all, you have to understand how levels work.<p class="paragraph"/><h4>Logging levels</h4><p class="paragraph"/>The are several standard logging levels, which are listed here in order of descending priority:
<ol>
<li>off</li>
<li>fatal</li>
<li>error</li>
<li>warn</li>
<li>info</li>
<li>debug</li>
<li>trace</li>
<li>all</li>
</ol><p class="paragraph"/>When you log a message, you implicitly give that message a level. For example, the method <code>log.error(msg)</code> will log a message at the 'error' level. Likewise, <code>log.debug(msg)</code> will log it at 'debug'. Each of the above levels apart from 'off' and 'all' have a corresponding log method of the same name.<p class="paragraph"/>The logging system uses that  <em class="italic">message</em>  level combined with the configuration for the logger (see next section) to determine whether the message gets written out. For example, if you have an 'org.example.domain' logger configured like so:<p class="paragraph"/><div class="code"><pre>warn 'org.example.domain'</pre></div><p class="paragraph"/>then messages with a level of 'warn', 'error', or 'fatal' will be written out. Messages at other levels will be ignored.<p class="paragraph"/>Before we go on to loggers, a quick note about those 'off' and 'all' levels. These are special in that they can only be used in the configuration; you can't log messages at these levels. So if you configure a logger with a level of 'off', then no messages will be written out. A level of 'all' means that you will see all messages. Simple.<p class="paragraph"/><h4>Loggers</h4><p class="paragraph"/>Loggers are fundamental to the logging system, but they are a source of some confusion. For a start, what are they? Are they shared? How do you configure them?<p class="paragraph"/>A logger is the object you log messages to, so in the call <code>log.debug(msg)</code>, <code>log</code> is a logger instance (of type <a href="http://commons.apache.org/logging/apidocs/org/apache/commons/logging/Log.html" target="blank">Log</a>). These loggers are cached and uniquely identified by name, so if two separate classes use loggers with the same name, those loggers are actually the same instance.<p class="paragraph"/>There are two main ways to get hold of a logger:
<ol>
<li>use the <code>log</code> instance injected into artifacts such as domain classes, controllers and services;</li>
<li>use the Commons Logging API directly.</li>
</ol><p class="paragraph"/>If you use the dynamic <code>log</code> property, then the name of the logger is 'grails.app.&#60;type&#62;.&#60;className&#62;', where <code>type</code> is the type of the artifact, for example 'controllers' or 'services', and <code>className</code> is the fully qualified name of the artifact. For example, if you have this service:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">package</span> org.example<p class="paragraph"/>class MyService &#123;
    &#8230;
&#125;</pre></div><p class="paragraph"/>then the name of the logger will be 'grails.app.services.org.example.MyService'.<p class="paragraph"/>For other classes, the typical approach is to store a logger based on the class name in a constant static field:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">package</span> org.other<p class="paragraph"/><span class="java&#45;keyword">import</span> org.apache.commons.logging.LogFactory<p class="paragraph"/>class MyClass &#123;
    <span class="java&#45;keyword">private</span> <span class="java&#45;keyword">static</span> <span class="java&#45;keyword">final</span> log = LogFactory.getLog(<span class="java&#45;keyword">this</span>)
    &#8230;
&#125;</pre></div><p class="paragraph"/>This will create a logger with the name 'org.other.MyClass' - note the lack of a 'grails.app.' prefix since the class isn't an artifact. You can also pass a name to the <code>getLog()</code> method, such as "myLogger", but this is less common because the logging system treats names with dots ('.') in a special way.<p class="paragraph"/><h4>Configuring loggers</h4><p class="paragraph"/>You have already seen how to configure loggers in Grails:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    error  'org.codehaus.groovy.grails.web.servlet'
&#125;</pre></div><p class="paragraph"/>This example configures loggers with names starting with 'org.codehaus.groovy.grails.web.servlet' to ignore any messages sent to them at a level of 'warn' or lower. But is there a logger with this name in the application? No. So why have a configuration for it? Because the above rule applies to any logger whose name  <em class="italic">begins with</em>  'org.codehaus.groovy.grails.servlet.' as well. For example, the rule applies to both the <code>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</code> class and the <code>org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest</code> one.<p class="paragraph"/>In other words, loggers are hierarchical. This makes configuring them by package much simpler than it would otherwise be.<p class="paragraph"/>The most common things that you will want to capture log output from are your controllers, services, and other artifacts. Use the convention mentioned earlier to do that:  <em class="italic">grails.app.&#60;artifactType&#62;.&#60;className&#62;</em> . In particular the class name must be fully qualifed, i.e. with the package if there is one:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    // Set level <span class="java&#45;keyword">for</span> all application artifacts
    info <span class="java&#45;quote">"grails.app"</span><p class="paragraph"/>    // Set <span class="java&#45;keyword">for</span> a specific controller in the <span class="java&#45;keyword">default</span> <span class="java&#45;keyword">package</span>
    debug <span class="java&#45;quote">"grails.app.controllers.YourController"</span><p class="paragraph"/>    // Set <span class="java&#45;keyword">for</span> a specific domain class
    debug <span class="java&#45;quote">"grails.app.domain.org.example.Book"</span><p class="paragraph"/>    // Set <span class="java&#45;keyword">for</span> all taglibs
    info <span class="java&#45;quote">"grails.app.taglib"</span>
&#125;</pre></div><p class="paragraph"/>The standard artifact names used in the logging configuration are:
<ul class="star">
<li><code>conf</code> - For anything under <code>grails-app/conf</code> such as <code>BootStrap.groovy</code> (but excluding filters)</li>
<li><code>filters</code> - For filters</li>
<li><code>taglib</code> - For tag libraries</li>
<li><code>services</code> - For service classes</li>
<li><code>controllers</code> - For controllers</li>
<li><code>domain</code> - For domain entities</li>
</ul><p class="paragraph"/>Grails itself generates plenty of logging information and it can sometimes be helpful to see that. Here are some useful loggers from Grails internals that you can use, especially when tracking down problems with your application:
<ul class="star">
<li><code>org.codehaus.groovy.grails.commons</code> - Core artifact information such as class loading etc.</li>
<li><code>org.codehaus.groovy.grails.web</code> - Grails web request processing</li>
<li><code>org.codehaus.groovy.grails.web.mapping</code> - URL mapping debugging</li>
<li><code>org.codehaus.groovy.grails.plugins</code> - Log plugin activity</li>
<li><code>grails.spring</code> - See what Spring beans Grails and plugins are defining</li>
<li><code>org.springframework</code> - See what Spring is doing</li>
<li><code>org.hibernate</code> - See what Hibernate is doing</li>
</ul><p class="paragraph"/>So far, we've only looked at explicit configuration of loggers. But what about all those loggers that  <em class="italic">don't</em>  have an explicit configuration? Are they simply ignored? The answer lies with the root logger.<p class="paragraph"/><h4>The Root Logger</h4><p class="paragraph"/>All logger objects inherit their configuration from the root logger, so if no explicit configuration is provided for a given logger, then any messages that go to that logger are subject to the rules defined for the root logger. In other words, the root logger provides the default configuration for the logging system.<p class="paragraph"/>Grails automatically configures the root logger to only handle messages at 'error' level and above, and all the messages are directed to the console (stdout for those with a C background). You can customise this behaviour by specifying a 'root' section in your logging configuration like so:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    root &#123;
        info()
    &#125;
    &#8230;
&#125;</pre></div><p class="paragraph"/>The above example configures the root logger to log messages at 'info' level and above to the default console appender. You can also configure the root logger to log to one or more named appenders (which we'll talk more about shortly):<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        file name:'file', file:'/<span class="java&#45;keyword">var</span>/logs/mylog.log'
    &#125;
    root &#123;
        debug 'stdout', 'file'
    &#125;
&#125;</pre></div><p class="paragraph"/>In the above example, the root logger will log to two appenders - the default 'stdout' (console) appender and a custom 'file' appender.<p class="paragraph"/>For power users there is an alternative syntax for configuring the root logger: the root <code>org.apache.log4j.Logger</code> instance is passed as an argument to the log4j closure. This lets you work with the logger directly:<p class="paragraph"/><div class="code"><pre>log4j = &#123; root &#45;&#62;
    root.level = org.apache.log4j.Level.DEBUG
    &#8230;
&#125;</pre></div><p class="paragraph"/>For more information on what you can do with this <code>Logger</code> instance, refer to the Log4j API documentation.<p class="paragraph"/>Those are the basics of logging pretty well covered and they are sufficient if you're happy to only send log messages to the console. But what if you want to send them to a file? How do you make sure that messages from a particular logger go to a file but not the console? These questions and more will be answered as we look into appenders.<p class="paragraph"/><h3>Appenders</h3><p class="paragraph"/>Loggers are a useful mechanism for filtering messages, but they don't physically write the messages anywhere. That's the job of the appender, of which there are various types. For example, there is the default one that writes messages to the console, another that writes them to a file, and several others. You can even create your own appender implementations&#33;<p class="paragraph"/>This diagram shows how they fit into the logging pipeline:<p class="paragraph"/><img border="0" class="center" src="../img/logging.png"></img><p class="paragraph"/>As you can see, a single logger may have several appenders attached to it. In a standard Grails configuration, the console appender named 'stdout' is attached to all loggers through the default root logger configuration. But that's the only one. Adding more appenders can be done within an 'appenders' block:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        rollingFile name: <span class="java&#45;quote">"myAppender"</span>,
                    maxFileSize: 1024,
                    file: <span class="java&#45;quote">"/tmp/logs/myApp.log"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>The following appenders are available by default:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Name</strong></th><th><strong class="bold">Class</strong></th><th><strong class="bold">Description</strong></th></tr><tr class="table-odd"><td>jdbc</td><td><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/jdbc/JDBCAppender.html" target="blank">JDBCAppender</a></td><td>Logs to a JDBC connection.</td></tr><tr class="table-even"><td>console</td><td><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/ConsoleAppender.html" target="blank">ConsoleAppender</a></td><td>Logs to the console.</td></tr><tr class="table-odd"><td>file</td><td><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/FileAppender.html" target="blank">FileAppender</a></td><td>Logs to a single file.</td></tr><tr class="table-even"><td>rollingFile</td><td><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html" target="blank">RollingFileAppender</a></td><td>Logs to rolling files, for example a new file each day.</td></tr></table><p class="paragraph"/>Each named argument passed to an appender maps to a property of the underlying <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Appender.html" target="blank">Appender</a> implementation. So the previous example sets the <code>name</code>, <code>maxFileSize</code> and <code>file</code> properties of the <code>RollingFileAppender</code> instance.<p class="paragraph"/>You can have as many appenders as you like - just make sure that they all have unique names. You can even have multiple instances of the same appender type, for example several file appenders that log to different files.<p class="paragraph"/>If you prefer to create the appender programmatically or if you want to use an appender implementation that's not available in the above syntax, simply declare an <code>appender</code> entry with an instance of the appender you want:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> org.apache.log4j.&#42;<p class="paragraph"/>log4j = &#123;
    appenders &#123;
        appender <span class="java&#45;keyword">new</span> RollingFileAppender(
                name: <span class="java&#45;quote">"myAppender"</span>,
                maxFileSize: 1024,
                file: <span class="java&#45;quote">"/tmp/logs/myApp.log"</span>)
    &#125;
&#125;</pre></div><p class="paragraph"/>This approach can be used to configure <code>JMSAppender</code>, <code>SocketAppender</code>, <code>SMTPAppender</code>, and more.<p class="paragraph"/>Once you have declared your extra appenders, you can attach them to specific loggers by passing the name as a key to one of the log level methods from the previous section:<p class="paragraph"/><div class="code"><pre>error myAppender: <span class="java&#45;quote">"grails.app.controllers.BookController"</span></pre></div><p class="paragraph"/>This will ensure that the 'grails.app.controllers.BookController' logger sends log messages to 'myAppender' as well as any appenders configured for the root logger. To add more than one appender to the logger, then add them to the same level declaration:<p class="paragraph"/><div class="code"><pre>error myAppender:      <span class="java&#45;quote">"grails.app.controllers.BookController"</span>,
      myFileAppender:  &#91;<span class="java&#45;quote">"grails.app.controllers.BookController"</span>,
                        <span class="java&#45;quote">"grails.app.services.BookService"</span>&#93;,
      rollingFile:     <span class="java&#45;quote">"grails.app.controllers.BookController"</span></pre></div><p class="paragraph"/>The above example also shows how you can configure more than one logger at a time for a given appender (<code>myFileAppender</code>) by using a list.<p class="paragraph"/>Be aware that you can only configure a single level for a logger, so if you tried this code:<p class="paragraph"/><div class="code"><pre>error myAppender:      <span class="java&#45;quote">"grails.app.controllers.BookController"</span>
debug myFileAppender:  <span class="java&#45;quote">"grails.app.controllers.BookController"</span>
fatal rollingFile:     <span class="java&#45;quote">"grails.app.controllers.BookController"</span></pre></div><p class="paragraph"/>you'd find that only 'fatal' level messages get logged for 'grails.app.controllers.BookController'. That's because the last level declared for a given logger wins. What you probably want to do is limit what level of messages an appender writes.<p class="paragraph"/>An appender that is attached to a logger configured with the 'all' level will generate a lot of logging information. That may be fine in a file, but it makes working at the console difficult. So we configure the console appender to only write out messages at 'info' level or above:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        console name: <span class="java&#45;quote">"stdout"</span>, threshold: org.apache.log4j.Level.INFO
    &#125;
&#125;</pre></div><p class="paragraph"/>The key here is the <code>threshold</code> argument which determines the cut-off for log messages. This argument is available for all appenders, but do note that you currently have to specify a <code>Level</code> instance - a string such as "info" will not work.<p class="paragraph"/><h3>Custom Layouts</h3><p class="paragraph"/>By default the Log4j DSL assumes that you want to use a <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html" target="blank">PatternLayout</a>. However, there are other layouts available including:
<ul class="star">
<li><code>xml</code> - Create an XML log file</li>
<li><code>html</code> - Creates an HTML log file</li>
<li><code>simple</code> - A simple textual log</li>
<li><code>pattern</code> - A Pattern layout</li>
</ul><p class="paragraph"/>You can specify custom patterns to an appender using the <code>layout</code> setting:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        console name: <span class="java&#45;quote">"customAppender"</span>,
                layout: pattern(conversionPattern: <span class="java&#45;quote">"%c&#123;2&#125; %m%n"</span>)
    &#125;
&#125;</pre></div><p class="paragraph"/>This also works for the built-in appender "stdout", which logs to the console:
<div class="code"><pre>log4j = &#123;
    appenders &#123;
        console name: <span class="java&#45;quote">"stdout"</span>,
                layout: pattern(conversionPattern: <span class="java&#45;quote">"%c&#123;2&#125; %m%n"</span>)
    &#125;
&#125;</pre></div><p class="paragraph"/><h3>Environment-specific configuration</h3><p class="paragraph"/>Since the logging configuration is inside <code>Config.groovy</code>, you can put it inside an environment-specific block. However, there is a problem with this approach: you have to provide the full logging configuration each time you define the <code>log4j</code> setting. In other words, you cannot selectively override parts of the configuration - it's all or nothing.<p class="paragraph"/>To get around this, the logging DSL provides its own environment blocks that you can put anywhere in the configuration:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        console name: <span class="java&#45;quote">"stdout"</span>,
                layout: pattern(conversionPattern: <span class="java&#45;quote">"%c&#123;2&#125; %m%n"</span>)<p class="paragraph"/>        environments &#123;
            production &#123;
                rollingFile name: <span class="java&#45;quote">"myAppender"</span>, maxFileSize: 1024,
                            file: <span class="java&#45;quote">"/tmp/logs/myApp.log"</span>
            &#125;
        &#125;
    &#125;<p class="paragraph"/>    root &#123;
        //&#8230;
    &#125;<p class="paragraph"/>    // other shared config
    info <span class="java&#45;quote">"grails.app.controller"</span><p class="paragraph"/>    environments &#123;
        production &#123;
            // Override previous setting <span class="java&#45;keyword">for</span> 'grails.app.controller'
            error <span class="java&#45;quote">"grails.app.controllers"</span>
        &#125;
    &#125;
&#125;</pre></div><p class="paragraph"/>The one place you can't put an environment block is  <em class="italic">inside</em>  the <code>root</code> definition, but you can put the <code>root</code> definition inside an environment block.<p class="paragraph"/><h3>Full stacktraces</h3><p class="paragraph"/>When exceptions occur, there can be an awful lot of noise in the stacktrace from Java and Groovy internals. Grails filters these typically irrelevant details and restricts traces to non-core Grails/Groovy class packages.<p class="paragraph"/>When this happens, the full trace is always logged to the <code>StackTrace</code> logger, which by default writes its output to a file called <code>stacktrace.log</code>. As with other loggers though, you can change its behaviour in the configuration. For example if you prefer full stack traces to go to the console, add this entry:<p class="paragraph"/><div class="code"><pre>error stdout: <span class="java&#45;quote">"StackTrace"</span></pre></div><p class="paragraph"/>This won't stop Grails from attempting to create the stacktrace.log file - it just redirects where stack traces are written to. An alternative approach is to change the location of the 'stacktrace' appender's file:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        rollingFile name: <span class="java&#45;quote">"stacktrace"</span>, maxFileSize: 1024,
                    file: <span class="java&#45;quote">"/<span class="java&#45;keyword">var</span>/tmp/logs/myApp&#45;stacktrace.log"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>or, if you don't want to the 'stacktrace' appender at all, configure it as a 'null' appender:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        '<span class="java&#45;keyword">null</span>' name: <span class="java&#45;quote">"stacktrace"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>You can of course combine this with attaching the 'stdout' appender to the 'StackTrace' logger if you want all the output in the console.<p class="paragraph"/>Finally, you can completely disable stacktrace filtering by setting the <code>grails.full.stacktrace</code> VM property to <code>true</code>:<p class="paragraph"/><div class="code"><pre>grails &#45;Dgrails.full.stacktrace=<span class="java&#45;keyword">true</span> run&#45;app</pre></div><p class="paragraph"/><h3>Masking Request Parameters From Stacktrace Logs</h3><p class="paragraph"/>When Grails logs a stacktrace, the log message may include the names and values of all of the request parameters for the current request.  To mask out the values of secure request parameters, specify the parameter names in the <code>grails.exceptionresolver.params.exclude</code> config property:<p class="paragraph"/><div class="code"><pre>grails.exceptionresolver.params.exclude = &#91;'password', 'creditCard'&#93;</pre></div><p class="paragraph"/>Request parameter logging may be turned off altogether by setting the <code>grails.exceptionresolver.logRequestParameters</code> config property to <code>false</code>.  The default value is <code>true</code> when the application is running in DEVELOPMENT mode and <code>false</code> for all other modes.<p class="paragraph"/><div class="code"><pre>grails.exceptionresolver.logRequestParameters=<span class="java&#45;keyword">false</span></pre></div><p class="paragraph"/><h3>Logger inheritance</h3><p class="paragraph"/>Earlier, we mentioned that all loggers inherit from the root logger and that loggers are hierarchical based on '.'-separated terms. What this means is that unless you override a parent setting, a logger retains the level and the appenders configured for that parent. So with this configuration:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        file name:'file', file:'/<span class="java&#45;keyword">var</span>/logs/mylog.log'
    &#125;
    root &#123;
        debug 'stdout', 'file'
    &#125;
&#125;</pre></div><p class="paragraph"/>all loggers in the application will have a level of 'debug' and will log to both the 'stdout' and 'file' appenders. What if you only want to log to 'stdout' for a particular logger? Change the 'additivity' for a logger in that case.<p class="paragraph"/>Additivity simply determines whether a logger inherits the configuration from its parent. If additivity is false, then its not inherited. The default for all loggers is true, i.e. they inherit the configuration. So how do you change this setting? Here's an example:<p class="paragraph"/><div class="code"><pre>log4j = &#123;
    appenders &#123;
        &#8230;
    &#125;
    root &#123;
        &#8230;
    &#125;<p class="paragraph"/>    info additivity: <span class="java&#45;keyword">false</span>
         stdout: &#91;<span class="java&#45;quote">"grails.app.controllers.BookController"</span>,
                  <span class="java&#45;quote">"grails.app.services.BookService"</span>&#93;
&#125;</pre></div><p class="paragraph"/>So when you specify a log level, add an 'additivity' named argument. Note that you when you specify the additivity, you must configure the loggers for a named appender. The following syntax will  <em class="italic">not</em>  work:<p class="paragraph"/><div class="code"><pre>info additivity: <span class="java&#45;keyword">false</span>, &#91;<span class="java&#45;quote">"grails.app.controllers.BookController"</span>,
                         <span class="java&#45;quote">"grails.app.services.BookService"</span>&#93;</pre></div><p class="paragraph"/><h3>Customizing stack trace printing and filtering</h3><p class="paragraph"/>Stacktraces in general and those generated when using Groovy in particular are quite verbose and contain many stack frames that aren't interesting when diagnosing problems. So Grails uses a implementation of the <code>org.codehaus.groovy.grails.exceptions.StackTraceFilterer</code> interface to filter out irrelevant stack frames. To customize the approach used for filtering, implement that interface in a class in src/groovy or src/java and register it in <code>Config.groovy</code>:<p class="paragraph"/><div class="code"><pre>grails.logging.stackTraceFiltererClass =
         'com.yourcompany.yourapp.MyStackTraceFilterer'</pre></div><p class="paragraph"/>In addition, Grails customizes the display of the filtered stacktrace to make the information more readable. To customize this, implement the <code>org.codehaus.groovy.grails.exceptions.StackTracePrinter</code> interface in a class in src/groovy or src/java and register it in <code>Config.groovy</code>:<p class="paragraph"/><div class="code"><pre>grails.logging.stackTracePrinterClass =
         'com.yourcompany.yourapp.MyStackTracePrinter'</pre></div><p class="paragraph"/>Finally, to render error information in the error GSP, an HTML-generating printer implementation is needed. The default implementation is <code>org.codehaus.groovy.grails.web.errors.ErrorsViewStackTracePrinter</code> and it's registered as a Spring bean. To use your own implementation, either implement the <code>org.codehaus.groovy.grails.exceptions.StackTraceFilterer</code> directly or subclass <code>ErrorsViewStackTracePrinter</code> and register it in <code>grails-app/conf/spring/resources.groovy</code> as:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> com.yourcompany.yourapp.MyErrorsViewStackTracePrinter<p class="paragraph"/>beans = &#123;<p class="paragraph"/>    errorsViewStackTracePrinter(MyErrorsViewStackTracePrinter,
                                ref('grailsResourceLocator'))
&#125;</pre></div><p class="paragraph"/><h3>Alternative logging libraries</h3><p class="paragraph"/>By default, Grails uses Log4J to do its logging. For most people this is absolutely fine, and many users don't even care what logging library is used. But if you're not one of those and want to use an alternative, such as the <a href="http://download.oracle.com/javase/6/docs/api/index.html?java/util/logging/package-summary.html" target="blank">JDK logging package</a> or <a href="http://logback.qos.ch/" target="blank">logback</a>, you can do so by simply excluding a couple of dependencies from the global set and adding your own:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    inherits(<span class="java&#45;quote">"global"</span>) &#123;
        excludes <span class="java&#45;quote">"grails&#45;plugin&#45;logging"</span>, <span class="java&#45;quote">"log4j"</span>
    &#125;
    &#8230;
    dependencies &#123;
        runtime <span class="java&#45;quote">"ch.qos.logback:logback&#45;core:0.9.29"</span>
        &#8230;
    &#125;
    &#8230;
&#125;</pre></div><p class="paragraph"/>If you do this, you will get unfiltered, standard Java stacktraces in your log files and you won't be able to use the logging configuration DSL that's just been described. Instead, you will have to use the standard configuration mechanism for the library you choose.


<a name="3.1.3 GORM"><!-- Legacy link --></a>
<h2 id="configGORM">4.1.3 GORM</h2>
Grails provides the following GORM configuration options:
<ul class="star">
<li><code>grails.gorm.failOnError</code>  - If set to <code>true</code>, causes the <code>save()</code> method on domain classes to throw a <code>grails.validation.ValidationException</code> if <a href="../guide/single.html#validation" class="guide">validation</a> fails during a save.  This option may also be assigned a list of Strings representing package names.  If the value is a list of Strings then the failOnError behavior will only be applied to domain classes in those packages (including sub-packages).  See the <a href="../ref/Domain Classes/save.html" class="domainClasses">save</a> method docs for more information.</li>
</ul><p class="paragraph"/>For example, to enable failOnError for all domain classes:
<div class="code"><pre>grails.gorm.failOnError=<span class="java&#45;keyword">true</span></pre></div><p class="paragraph"/>and to enable failOnError for domain classes by package:
<div class="code"><pre>grails.gorm.failOnError = &#91;'com.companyname.somepackage',
                           'com.companyname.someotherpackage'&#93;</pre></div>
<ul class="star">
<li><code>grails.gorm.autoFlush</code> = If set to <code>true</code>, causes the <a href="../ref/Domain Classes/merge.html" class="domainClasses">merge</a>, <a href="../ref/Domain Classes/save.html" class="domainClasses">save</a> and <a href="../ref/Domain Classes/delete.html" class="domainClasses">delete</a> methods to flush the session, replacing the need to explicitly flush using <code>save(flush: true)</code>.</li>
</ul><p class="paragraph"/>

<a name="3.2 Environments"><!-- Legacy link --></a>
<h2 id="environments">4.2 Environments</h2>
<h4>Per Environment Configuration</h4><p class="paragraph"/>Grails supports the concept of per environment configuration. The <code>Config.groovy</code>, <code>DataSource.groovy</code>, and <code>BootStrap.groovy</code> files in the <code>grails-app/conf</code> directory can use per-environment configuration using the syntax provided by <a href="http://groovy.codehaus.org/ConfigSlurper" target="blank">ConfigSlurper</a>. As an example consider the following default <code>DataSource</code> definition provided by Grails:<p class="paragraph"/><div class="code"><pre>dataSource &#123;
    pooled = <span class="java&#45;keyword">false</span>
    driverClassName = <span class="java&#45;quote">"org.h2.Driver"</span>
    username = <span class="java&#45;quote">"sa"</span>
    password = <span class="java&#45;quote">""</span>
&#125;
environments &#123;
    development &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"create&#45;drop"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:devDb"</span>
        &#125;
    &#125;
    test &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:testDb"</span>
        &#125;
    &#125;
    production &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:prodDb"</span>
        &#125;
    &#125;
&#125;</pre></div><p class="paragraph"/>Notice how the common configuration is provided at the top level and then an <code>environments</code> block specifies per environment settings for the <code>dbCreate</code> and <code>url</code> properties of the <code>DataSource</code>.<p class="paragraph"/><h4>Packaging and Running for Different Environments</h4><p class="paragraph"/>Grails' <a href="../guide/single.html#commandLine" class="guide">command line</a> has built in capabilities to execute any command within the context of a specific environment. The format is:<p class="paragraph"/><div class="code"><pre>grails &#91;environment&#93; &#91;command name&#93;</pre></div><p class="paragraph"/>In addition, there are 3 preset environments known to Grails: <code>dev</code>, <code>prod</code>, and <code>test</code> for <code>development</code>, <code>production</code> and <code>test</code>. For example to create a WAR for the <code>test</code> environment you wound run:<p class="paragraph"/><div class="code"><pre>grails test war</pre></div><p class="paragraph"/>To target other environments you can pass a <code>grails.env</code> variable to any command:<p class="paragraph"/><div class="code"><pre>grails &#45;Dgrails.env=UAT run&#45;app</pre></div><p class="paragraph"/><h4>Programmatic Environment Detection</h4><p class="paragraph"/>Within your code, such as in a Gant script or a bootstrap class you can detect the environment using the <a href="../api/grails/util/Environment.html" class="api">Environment</a> class:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> grails.util.Environment<p class="paragraph"/>...<p class="paragraph"/><span class="java&#45;keyword">switch</span> (Environment.current) &#123;
    <span class="java&#45;keyword">case</span> Environment.DEVELOPMENT:
        configureForDevelopment()
        <span class="java&#45;keyword">break</span>
    <span class="java&#45;keyword">case</span> Environment.PRODUCTION:
        configureForProduction()
        <span class="java&#45;keyword">break</span>
&#125;</pre></div><p class="paragraph"/><h4>Per Environment Bootstrapping</h4><p class="paragraph"/>It's often desirable to run code when your application starts up on a per-environment basis. To do so you can use the <code>grails-app/conf/BootStrap.groovy</code> file's support for per-environment execution:<p class="paragraph"/><div class="code"><pre>def init = &#123; ServletContext ctx &#45;&#62;
    environments &#123;
        production &#123;
            ctx.setAttribute(<span class="java&#45;quote">"env"</span>, <span class="java&#45;quote">"prod"</span>)
        &#125;
        development &#123;
            ctx.setAttribute(<span class="java&#45;quote">"env"</span>, <span class="java&#45;quote">"dev"</span>)
        &#125;
    &#125;
    ctx.setAttribute(<span class="java&#45;quote">"foo"</span>, <span class="java&#45;quote">"bar"</span>)
&#125;</pre></div><p class="paragraph"/><h4>Generic Per Environment Execution</h4><p class="paragraph"/>The previous <code>BootStrap</code> example uses the <code>grails.util.Environment</code> class internally to execute. You can also use this class yourself to execute your own environment specific logic:<p class="paragraph"/><div class="code"><pre>Environment.executeForCurrentEnvironment &#123;
    production &#123;
        // <span class="java&#45;keyword">do</span> something in production
    &#125;
    development &#123;
        // <span class="java&#45;keyword">do</span> something only in development
    &#125;
&#125;</pre></div>


<a name="3.3 The DataSource"><!-- Legacy link --></a>
<h2 id="dataSource">4.3 The DataSource</h2>
Since Grails is built on Java technology setting up a data source requires some knowledge of JDBC (the technology that doesn't stand for Java Database Connectivity).<p class="paragraph"/>If you use a database other than H2 you need a JDBC driver. For example for MySQL you would need <a href="http://www.mysql.com/downloads/connector/j/" target="blank">Connector/J</a><p class="paragraph"/>Drivers typically come in the form of a JAR archive. It's best to use Ivy to resolve the jar if it's available in a Maven repository, for example you could add a dependency for the MySQL driver like this:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    inherits(<span class="java&#45;quote">"global"</span>)
    log <span class="java&#45;quote">"warn"</span>
    repositories &#123;
        grailsPlugins()
        grailsHome()
        grailsCentral()
        mavenCentral()
    &#125;
    dependencies &#123;
        runtime 'mysql:mysql&#45;connector&#45;java:5.1.16'
    &#125;
&#125;</pre></div><p class="paragraph"/>Note that the built-in <code>mavenCentral()</code> repository is included here since that's a reliable location for this library.<p class="paragraph"/>If you can't use Ivy then just put the JAR in your project's <code>lib</code> directory.<p class="paragraph"/>Once you have the JAR resolved you need to get familiar Grails' DataSource descriptor file located at <code>grails-app/conf/DataSource.groovy</code>. This file contains the dataSource definition which includes the following settings:
<ul class="star">
<li><code>driverClassName</code> - The class name of the JDBC driver</li>
<li><code>username</code> - The username used to establish a JDBC connection</li>
<li><code>password</code> - The password used to establish a JDBC connection</li>
<li><code>url</code> - The JDBC URL of the database</li>
<li><code>dbCreate</code> - Whether to auto-generate the database from the domain model - one of 'create-drop', 'create', 'update' or 'validate'</li>
<li><code>pooled</code> - Whether to use a pool of connections (defaults to true)</li>
<li><code>logSql</code> - Enable SQL logging to stdout</li>
<li><code>formatSql</code> - Format logged SQL</li>
<li><code>dialect</code> - A String or Class that represents the Hibernate dialect used to communicate with the database. See the <a href="http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/dialect/package-summary.html" target="blank">org.hibernate.dialect</a> package for available dialects.</li>
<li><code>readOnly</code> - If <code>true</code> makes the DataSource read-only, which results in the connection pool calling <code>setReadOnly(true)</code> on each <code>Connection</code></li>
<li><code>properties</code> - Extra properties to set on the DataSource bean. See the <a href="http://commons.apache.org/dbcp/api-1.2.2/org/apache/commons/dbcp/BasicDataSource.html" target="blank">Commons DBCP BasicDataSource</a> documentation.</li>
</ul><p class="paragraph"/>A typical configuration for MySQL may be something like:<p class="paragraph"/><div class="code"><pre>dataSource &#123;
    pooled = <span class="java&#45;keyword">true</span>
    dbCreate = <span class="java&#45;quote">"update"</span>
    url = <span class="java&#45;quote">"jdbc:mysql://localhost/yourDB"</span>
    driverClassName = <span class="java&#45;quote">"com.mysql.jdbc.Driver"</span>
    dialect = org.hibernate.dialect.MySQL5InnoDBDialect
    username = <span class="java&#45;quote">"yourUser"</span>
    password = <span class="java&#45;quote">"yourPassword"</span>
&#125;</pre></div><p class="paragraph"/><blockquote class="warning">
When configuring the DataSource do not include the type or the def keyword before any of the configuration settings as Groovy will treat these as local variable definitions and they will not be processed. For example the following is invalid:
</blockquote><p class="paragraph"/><div class="code"><pre>dataSource &#123;
    <span class="java&#45;object">boolean</span> pooled = <span class="java&#45;keyword">true</span> // type declaration results in ignored local variable
    &#8230;
&#125;</pre></div><p class="paragraph"/>Example of advanced configuration using extra properties:
<div class="code"><pre>dataSource &#123;
    pooled = <span class="java&#45;keyword">true</span>
    dbCreate = <span class="java&#45;quote">"update"</span>
    url = <span class="java&#45;quote">"jdbc:mysql://localhost/yourDB"</span>
    driverClassName = <span class="java&#45;quote">"com.mysql.jdbc.Driver"</span>
    dialect = org.hibernate.dialect.MySQL5InnoDBDialect
    username = <span class="java&#45;quote">"yourUser"</span>
    password = <span class="java&#45;quote">"yourPassword"</span>
    properties &#123;
        maxActive = 50
        maxIdle = 25
        minIdle = 5
        initialSize = 5
        minEvictableIdleTimeMillis = 60000
        timeBetweenEvictionRunsMillis = 60000
        maxWait = 10000
        validationQuery = <span class="java&#45;quote">"/&#42; ping &#42;/"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/><h4>More on dbCreate</h4><p class="paragraph"/>Hibernate can automatically create the database tables required for your domain model. You have some control over when and how it does this through the <code>dbCreate</code> property, which can take these values:
<ul class="star">
<li><strong class="bold">create</strong> - Drops the existing schemaCreates the schema on startup, dropping existing tables, indexes, etc. first.</li>
<li><strong class="bold">create-drop</strong> - Same as <strong class="bold">create</strong>, but also drops the tables when the application shuts down cleanly.</li>
<li><strong class="bold">update</strong> - Creates missing tables and indexes, and updates the current schema without dropping any tables or data. Note that this can't properly handle many schema changes like column renames (you're left with the old column containing the existing data).</li>
<li><strong class="bold">validate</strong> - Makes no changes to your database. Compares the configuration with the existing database schema and reports warnings.</li>
<li>any other value - does nothing</li>
</ul><p class="paragraph"/>You can also remove the <code>dbCreate</code> setting completely, which is recommended once your schema is relatively stable and definitely when your application and database are deployed in production. Database changes are then managed through proper migrations, either with SQL scripts or a migration tool like <a href="http://www.liquibase.org/" target="blank">Liquibase</a> (the <a href="http://grails.org/plugin/database-migration" target="blank">Database Migration</a> plugin uses Liquibase and is tightly integrated with Grails and GORM).


<a name="3.3.1 DataSources and Environments"><!-- Legacy link --></a>
<h2 id="dataSourcesAndEnvironments">4.3.1 DataSources and Environments</h2>
The previous example configuration assumes you want the same config for all environments: production, test, development etc.<p class="paragraph"/>Grails' DataSource definition is "environment aware", however, so you can do:<p class="paragraph"/><div class="code"><pre>dataSource &#123;
    pooled = <span class="java&#45;keyword">true</span>
    driverClassName = <span class="java&#45;quote">"com.mysql.jdbc.Driver"</span>
    dialect = org.hibernate.dialect.MySQL5InnoDBDialect
    // other common settings here
&#125;<p class="paragraph"/>environments &#123;
    production &#123;
        dataSource &#123;
            url = <span class="java&#45;quote">"jdbc:mysql://liveip.com/liveDb"</span>
            // other environment&#45;specific settings here
        &#125;
    &#125;
&#125;</pre></div>


<a name="3.3.2 JNDI DataSources"><!-- Legacy link --></a>
<h2 id="JNDIDataSources">4.3.2 JNDI DataSources</h2>
<h4>Referring to a JNDI DataSource</h4><p class="paragraph"/>Most Java EE containers supply <code>DataSource</code> instances via <a href="http://www.oracle.com/technetwork/java/jndi/index.html" target="blank">Java Naming and Directory Interface</a> (JNDI). Grails supports the definition of JNDI data sources as follows:<p class="paragraph"/><div class="code"><pre>dataSource &#123;
    jndiName = <span class="java&#45;quote">"java:comp/env/myDataSource"</span>
&#125;</pre></div><p class="paragraph"/>The format on the JNDI name may vary from container to container, but the way you define the <code>DataSource</code> in Grails remains the same.<p class="paragraph"/><h4>Configuring a Development time JNDI resource</h4><p class="paragraph"/>The way in which you configure JNDI data sources at development time is plugin dependent. Using the <a href="http://grails.org/plugin/tomcat" target="blank">Tomcat</a> plugin you can define JNDI resources using the <code>grails.naming.entries</code> setting in <code>grails-app/conf/Config.groovy</code>:<p class="paragraph"/><div class="code"><pre>grails.naming.entries = &#91;
    <span class="java&#45;quote">"bean/MyBeanFactory"</span>: &#91;
        auth: <span class="java&#45;quote">"Container"</span>,
        type: <span class="java&#45;quote">"com.mycompany.MyBean"</span>,
        factory: <span class="java&#45;quote">"org.apache.naming.factory.BeanFactory"</span>,
        bar: <span class="java&#45;quote">"23"</span>
    &#93;,
    <span class="java&#45;quote">"jdbc/EmployeeDB"</span>: &#91;
        type: <span class="java&#45;quote">"javax.sql.DataSource"</span>, //required
        auth: <span class="java&#45;quote">"Container"</span>, // optional
        description: <span class="java&#45;quote">"Data source <span class="java&#45;keyword">for</span> Foo"</span>, //optional
        driverClassName: <span class="java&#45;quote">"org.h2.Driver"</span>,
        url: <span class="java&#45;quote">"jdbc:h2:mem:database"</span>,
        username: <span class="java&#45;quote">"dbusername"</span>,
        password: <span class="java&#45;quote">"dbpassword"</span>,
        maxActive: <span class="java&#45;quote">"8"</span>,
        maxIdle: <span class="java&#45;quote">"4"</span>
    &#93;,
    <span class="java&#45;quote">"mail/session"</span>: &#91;
        type: <span class="java&#45;quote">"javax.mail.Session,
        auth: "</span>Container<span class="java&#45;quote">",
        "</span>mail.smtp.host<span class="java&#45;quote">": "</span>localhost"
    &#93;
&#93;</pre></div>


<a name="3.3.3 Automatic Database Migration"><!-- Legacy link --></a>
<h2 id="automaticDatabaseMigration">4.3.3 Automatic Database Migration</h2>
The <code>dbCreate</code> property of the <code>DataSource</code> definition is important as it dictates what Grails should do at runtime with regards to automatically generating the database tables from <a href="../guide/single.html#GORM" class="guide">GORM</a> classes. The options are described in the <a href="../guide/single.html#dataSource" class="guide">DataSource</a> section:
<ul class="star">
<li><code>create</code></li>
<li><code>create-drop</code></li>
<li><code>update</code></li>
<li><code>validate</code></li>
<li>no value</li>
</ul><p class="paragraph"/>In <a href="../guide/single.html#environments" class="guide">development</a> mode <code>dbCreate</code> is by default set to "create-drop", but at some point in development (and certainly once you go to production) you'll need to stop dropping and re-creating the database every time you start up your server.<p class="paragraph"/>It's tempting to switch to <code>update</code> so you retain existing data and only update the schema when your code changes, but Hibernate's update support is very conservative. It won't make any changes that could result in data loss, and doesn't detect renamed columns or tables, so you'll be left with the old one and will also have the new one.<p class="paragraph"/>Grails supports Rails-style migrations via the <a href="http://grails.org/plugin/database-migration" target="blank">Database Migration</a> plugin which can be installed by running<p class="paragraph"/><pre class="bq"><code>
grails install-plugin database-migration</code></pre><p class="paragraph"/>The plugin uses <a href="http://www.liquibase.org/" target="blank">Liquibase</a> and and provides access to all of its functionality, and also has support for GORM (for example generating a change set by comparing your domain classes to a database).


<a name="3.3.4 Transaction-aware DataSource Proxy"><!-- Legacy link --></a>
<h2 id="transactionAwareDataSourceProxy">4.3.4 Transaction-aware DataSource Proxy</h2>
The actual <code>dataSource</code> bean is wrapped in a transaction-aware proxy so you will be given the connection that's being used by the current transaction or Hibernate <code>Session</code> if one is active.<p class="paragraph"/>If this were not the case, then retrieving a connection from the <code>dataSource</code> would be a new connection, and you wouldn't be able to see changes that haven't been committed yet (assuming you have a sensible transaction isolation setting, e.g. <code>READ_COMMITTED</code> or better).<p class="paragraph"/>The "real" unproxied <code>dataSource</code> is still available to you if you need access to it; its bean name is <code>dataSourceUnproxied</code>.<p class="paragraph"/>You can access this bean like any other Spring bean, i.e. using dependency injection:<p class="paragraph"/><div class="code"><pre>class MyService &#123;<p class="paragraph"/>   def dataSourceUnproxied
   &#8230;
&#125;</pre></div><p class="paragraph"/>or by pulling it from the <code>ApplicationContext</code>:<p class="paragraph"/><div class="code"><pre>def dataSourceUnproxied = ctx.dataSourceUnproxied</pre></div>


<a name="3.3.5 Database Console"><!-- Legacy link --></a>
<h2 id="databaseConsole">4.3.5 Database Console</h2>
The <a href="http://h2database.com/html/quickstart.html#h2_console" target="blank">H2 database console</a> is a convenient feature of H2 that provides a web-based interface to any database that you have a JDBC driver for, and it's very useful to view the database you're developing against. It's especially useful when running against an in-memory database.<p class="paragraph"/>You can access the console by navigating to <strong class="bold">http://localhost:8080/appname/dbconsole</strong> in a browser. The URI can be configured using the <code>grails.dbconsole.urlRoot</code> attribute in Config.groovy and defaults to <code>'/dbconsole'</code>.<p class="paragraph"/>The console is enabled by default in development mode and can be disabled or enabled in other environments by using the <code>grails.dbconsole.enabled</code> attribute in Config.groovy. For example you could enable the console in production using<p class="paragraph"/><div class="code"><pre>environments &#123;
    production &#123;
        grails.serverURL = <span class="java&#45;quote">"http://www.changeme.com"</span>
        grails.dbconsole.enabled = <span class="java&#45;keyword">true</span>
        grails.dbconsole.urlRoot = '/admin/dbconsole'
    &#125;
    development &#123;
        grails.serverURL = <span class="java&#45;quote">"http://localhost:8080/&#36;&#123;appName&#125;"</span>
    &#125;
    test &#123;
        grails.serverURL = <span class="java&#45;quote">"http://localhost:8080/&#36;&#123;appName&#125;"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/><blockquote class="warning">
If you enable the console in production be sure to guard access to it using a trusted security framework.
</blockquote><p class="paragraph"/><h4>Configuration</h4><p class="paragraph"/>By default the console is configured for an H2 database which will work with the default settings if you haven't configured an external database - you just need to change the JDBC URL to <code>jdbc:h2:mem:devDB</code>. If you've configured an external database (e.g. MySQL, Oracle, etc.) then you can use the Saved Settings dropdown to choose a settings template and fill in the url and username/password information from your DataSource.groovy.


<a name="3.3.6 Multiple Datasources"><!-- Legacy link --></a>
<h2 id="multipleDatasources">4.3.6 Multiple Datasources</h2>
By default all domain classes share a single <code>DataSource</code> and a single database, but you have the option to partition your domain classes into two or more <code>DataSource</code>s.<p class="paragraph"/><h4>Configuring Additional DataSources</h4><p class="paragraph"/>The default <code>DataSource</code> configuration in <code>grails-app/conf/DataSource.groovy</code> looks something like this:<p class="paragraph"/><div class="code"><pre>dataSource &#123;
    pooled = <span class="java&#45;keyword">true</span>
    driverClassName = <span class="java&#45;quote">"org.h2.Driver"</span>
    username = <span class="java&#45;quote">"sa"</span>
    password = <span class="java&#45;quote">""</span>
&#125;
hibernate &#123;
    cache.use_second_level_cache = <span class="java&#45;keyword">true</span>
    cache.use_query_cache = <span class="java&#45;keyword">true</span>
    cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
&#125;<p class="paragraph"/>environments &#123;
    development &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"create&#45;drop"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:devDb"</span>
        &#125;
    &#125;
    test &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:testDb"</span>
        &#125;
    &#125;
    production &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:prodDb"</span>
        &#125;
    &#125;
&#125;</pre></div><p class="paragraph"/>This configures a single <code>DataSource</code> with the Spring bean named <code>dataSource</code>. To configure extra <code>DataSource</code>s, add another <code>dataSource</code> block (at the top level, in an environment block, or both, just like the standard <code>DataSource</code> definition) with a custom name, separated by an underscore. For example, this configuration adds a second <code>DataSource</code>, using MySQL in the development environment and Oracle in production:<p class="paragraph"/><div class="code"><pre>environments &#123;
    development &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"create&#45;drop"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:devDb"</span>
        &#125;
        dataSource_lookup &#123;
            dialect = org.hibernate.dialect.MySQLInnoDBDialect
            driverClassName = 'com.mysql.jdbc.Driver'
            username = 'lookup'
            password = 'secret'
            url = 'jdbc:mysql://localhost/lookup'
            dbCreate = 'update'
        &#125;
    &#125;
    test &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:mem:testDb"</span>
        &#125;
    &#125;
    production &#123;
        dataSource &#123;
            dbCreate = <span class="java&#45;quote">"update"</span>
            url = <span class="java&#45;quote">"jdbc:h2:prodDb"</span>
        &#125;
        dataSource_lookup &#123;
            dialect = org.hibernate.dialect.Oracle10gDialect
            driverClassName = 'oracle.jdbc.driver.OracleDriver'
            username = 'lookup'
            password = 'secret'
            url = 'jdbc:oracle:thin:@localhost:1521:lookup'
            dbCreate = 'update'
        &#125;
    &#125;
&#125;</pre></div><p class="paragraph"/>You can use the same or different databases as long as they're supported by Hibernate.<p class="paragraph"/><h4>Configuring Domain Classes</h4><p class="paragraph"/>If a domain class has no <code>DataSource</code> configuration, it defaults to the standard <code>'dataSource'</code>. Set the <code>datasource</code> property in the <code>mapping</code> block to configure a non-default <code>DataSource</code>. For example, if you want to use the <code>ZipCode</code> domain to use the <code>'lookup'</code> <code>DataSource</code>, configure it like this;<p class="paragraph"/><div class="code"><pre>class ZipCode &#123;<p class="paragraph"/>   <span class="java&#45;object">String</span> code<p class="paragraph"/>   <span class="java&#45;keyword">static</span> mapping = &#123;
      datasource 'lookup'
   &#125;
&#125;</pre></div><p class="paragraph"/>A domain class can also use two or more <code>DataSource</code>s. Use the <code>datasources</code> property with a list of names to configure more than one, for example:<p class="paragraph"/><div class="code"><pre>class ZipCode &#123;<p class="paragraph"/>   <span class="java&#45;object">String</span> code<p class="paragraph"/>   <span class="java&#45;keyword">static</span> mapping = &#123;
      datasources(&#91;'lookup', 'auditing'&#93;)
   &#125;
&#125;</pre></div><p class="paragraph"/>If a domain class uses the default <code>DataSource</code> and one or more others, use the special name <code>'DEFAULT'</code> to indicate the default <code>DataSource</code>:<p class="paragraph"/><div class="code"><pre>class ZipCode &#123;<p class="paragraph"/>   <span class="java&#45;object">String</span> code<p class="paragraph"/>   <span class="java&#45;keyword">static</span> mapping = &#123;
      datasources(&#91;'lookup', 'DEFAULT'&#93;)
   &#125;
&#125;</pre></div><p class="paragraph"/>If a domain class uses all configured <code>DataSource</code>s use the special value <code>'ALL'</code>:<p class="paragraph"/><div class="code"><pre>class ZipCode &#123;<p class="paragraph"/>   <span class="java&#45;object">String</span> code<p class="paragraph"/>   <span class="java&#45;keyword">static</span> mapping = &#123;
      datasource 'ALL'
   &#125;
&#125;</pre></div><p class="paragraph"/><h4>Namespaces and GORM Methods</h4><p class="paragraph"/>If a domain class uses more than one <code>DataSource</code> then you can use the namespace implied by each <code>DataSource</code> name to make GORM calls for a particular <code>DataSource</code>. For example, consider this class which uses two <code>DataSource</code>s:<p class="paragraph"/><div class="code"><pre>class ZipCode &#123;<p class="paragraph"/>   <span class="java&#45;object">String</span> code<p class="paragraph"/>   <span class="java&#45;keyword">static</span> mapping = &#123;
      datasources(&#91;'lookup', 'auditing'&#93;)
   &#125;
&#125;</pre></div><p class="paragraph"/>The first <code>DataSource</code> specified is the default when not using an explicit namespace, so in this case we default to 'lookup'. But you can call GORM methods on the 'auditing' <code>DataSource</code> with the <code>DataSource</code> name, for example:<p class="paragraph"/><div class="code"><pre>def zipCode = ZipCode.auditing.get(42)
&#8230;
zipCode.auditing.save()</pre></div><p class="paragraph"/>As you can see, you add the <code>DataSource</code> to the method call in both the static case and the instance case.<p class="paragraph"/><h4>Hibernate Mapped Domain Classes</h4><p class="paragraph"/>You can also partition annotated Java classes into separate datasources. Classes using the default datasource are registered in <code>grails-app/conf/hibernate/hibernate.cfg.xml</code>. To specify that an annotated class uses a non-default datasource, create a <code>hibernate.cfg.xml</code> file for that datasource with the file name prefixed with the datasource name.<p class="paragraph"/>For example if the <code>Book</code> class is in the default datasource, you would register that in <code>grails-app/conf/hibernate/hibernate.cfg.xml</code>:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;?xml version='1.0' encoding='UTF&#45;8'?&#62;</span>
&#60;!DOCTYPE hibernate&#45;configuration PUBLIC
          '&#45;//Hibernate/Hibernate Configuration DTD 3.0//EN'
          'http://hibernate.sourceforge.net/hibernate&#45;configuration&#45;3.0.dtd'&#62;
<span class="xml&#45;tag">&#60;hibernate&#45;configuration&#62;</span>
   <span class="xml&#45;tag">&#60;session&#45;factory&#62;</span>
      <span class="xml&#45;tag">&#60;mapping class='org.example.Book'/&#62;</span>
   <span class="xml&#45;tag">&#60;/session&#45;factory&#62;</span>
<span class="xml&#45;tag">&#60;/hibernate&#45;configuration&#62;</span></pre></div><p class="paragraph"/>and if the <code>Library</code> class is in the "ds2" datasource, you would register that in <code>grails-app/conf/hibernate/ds2_hibernate.cfg.xml</code>:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;?xml version='1.0' encoding='UTF&#45;8'?&#62;</span>
&#60;!DOCTYPE hibernate&#45;configuration PUBLIC
          '&#45;//Hibernate/Hibernate Configuration DTD 3.0//EN'
          'http://hibernate.sourceforge.net/hibernate&#45;configuration&#45;3.0.dtd'&#62;
<span class="xml&#45;tag">&#60;hibernate&#45;configuration&#62;</span>
   <span class="xml&#45;tag">&#60;session&#45;factory&#62;</span>
      <span class="xml&#45;tag">&#60;mapping class='org.example.Library'/&#62;</span>
   <span class="xml&#45;tag">&#60;/session&#45;factory&#62;</span>
<span class="xml&#45;tag">&#60;/hibernate&#45;configuration&#62;</span></pre></div><p class="paragraph"/>The process is the same for classes mapped with hbm.xml files - just list them in the appropriate hibernate.cfg.xml file.<p class="paragraph"/><h4>Services</h4><p class="paragraph"/>Like Domain classes, by default Services use the default <code>DataSource</code> and <code>PlatformTransactionManager</code>. To configure a Service to use a different <code>DataSource</code>, use the static <code>datasource</code> property, for example:<p class="paragraph"/><div class="code"><pre>class DataService &#123;<p class="paragraph"/>   <span class="java&#45;keyword">static</span> datasource = 'lookup'<p class="paragraph"/>   void someMethod(...) &#123;
      &#8230;
   &#125;
&#125;</pre></div><p class="paragraph"/>A transactional service can only use a single <code>DataSource</code>, so be sure to only make changes for domain classes whose <code>DataSource</code> is the same as the Service.<p class="paragraph"/>Note that the datasource specified in a service has no bearing on which datasources are used for domain classes; that's determined by their declared datasources in the domain classes themselves. It's used to declare which transaction manager to use.<p class="paragraph"/>What you'll see is that if you have a Foo domain class in dataSource1 and a Bar domain class in dataSource2, and WahooService uses dataSource1, a service method that saves a new Foo and a new Bar will only be transactional for Foo since they share the datasource. The transaction won't affect the Bar instance. If you want both to be transactional you'd need to use two services and XA datasources for two-phase commit, e.g. with the Atomikos plugin.<p class="paragraph"/><h4>XA and Two-phase Commit</h4><p class="paragraph"/>Grails has no native support for <a href="https://secure.wikimedia.org/wikipedia/en/wiki/X/Open_XA" target="blank">XA</a> <code>DataSource</code>s or <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Two-phase_commit" target="blank">two-phase commit</a>, but the <a href="http://grails.org/plugin/atomikos" target="blank">Atomikos plugin</a> makes it easy. See the plugin documentation for the simple changes needed in your <code>DataSource</code> definitions to reconfigure them as XA <code>DataSource</code>s.<p class="paragraph"/>

<a name="3.4 Externalized Configuration"><!-- Legacy link --></a>
<h2 id="configExternalized">4.4 Externalized Configuration</h2>
Some deployments require that configuration be sourced from more than one place and be changeable without requiring a rebuild of the application. In order to support deployment scenarios such as these the configuration can be externalized. To do so, point Grails at the locations of the configuration files that should be used by adding a <code>grails.config.locations</code> setting in <code>Config.groovy</code>, for example:<p class="paragraph"/><div class="code"><pre>grails.config.locations = &#91;
    <span class="java&#45;quote">"classpath:$&#123;appName&#125;&#45;config.properties"</span>,
    <span class="java&#45;quote">"classpath:$&#123;appName&#125;&#45;config.groovy"</span>,
    <span class="java&#45;quote">"file:$&#123;userHome&#125;/.grails/$&#123;appName&#125;&#45;config.properties"</span>,
    <span class="java&#45;quote">"file:$&#123;userHome&#125;/.grails/$&#123;appName&#125;&#45;config.groovy"</span> &#93;</pre></div><p class="paragraph"/>In the above example we're loading configuration files (both Java Properties files and <a href="http://groovy.codehaus.org/ConfigSlurper" target="blank">ConfigSlurper</a> configurations) from different places on the classpath and files located in <code>USER_HOME</code>.<p class="paragraph"/>It is also possible to load config by specifying a class that is a config script.<p class="paragraph"/><div class="code"><pre>grails.config.locations = &#91;com.my.app.MyConfig&#93;</pre></div><p class="paragraph"/>This can be useful in situations where the config is either coming from a plugin or some other part of your application. A typical use for this is re-using configuration provided by plugins across multiple applications.<p class="paragraph"/>Ultimately all configuration files get merged into the <code>config</code> property of the <a href="../api/org/codehaus/groovy/grails/commons/GrailsApplication.html" class="api">GrailsApplication</a> object and are hence obtainable from there.<p class="paragraph"/>Values that have the same name as previously defined values will overwrite the existing values, and the pointed to configuration sources are loaded in the order in which they are defined.<p class="paragraph"/><h4>Config Defaults</h4><p class="paragraph"/>The configuration values contained in the locations described by the <code>grails.config.locations</code> property will <strong class="bold">override</strong> any values defined in your application <code>Config.groovy</code> file which may not be what you want. You may want to have a set of  <em class="italic">default</em>  values be be loaded that can be overridden in either your application's <code>Config.groovy</code> file or in a named config location. For this you can use the <code>grails.config.defaults.locations</code> property.<p class="paragraph"/>This property supports the same values as the <code>grails.config.locations</code> property (i.e. paths to config scripts, property files or classes), but the config described by <code>grails.config.defaults.locations</code> will be loaded  <em class="italic">before</em>  all other values and can therefore be overridden. Some plugins use this mechanism to supply one or more sets of default configuration that you can choose to include in your application config.<p class="paragraph"/><blockquote class="note">
Grails also supports the concept of property place holders and property override configurers as defined in <a href="http://www.springframework.org." target="blank">Spring</a> For more information on these see the section on <a href="../guide/single.html#spring" class="guide">Grails and Spring</a>
</blockquote>


<a name="3.5 Versioning"><!-- Legacy link --></a>
<h2 id="versioning">4.5 Versioning</h2>
<h4>Versioning Basics</h4><p class="paragraph"/>Grails has built in support for application versioning. The version of the application is set to <code>0.1</code> when you first create an application with the <a href="../ref/Command Line/create-app.html" class="commandLine">create-app</a> command. The version is stored in the application meta data file <code>application.properties</code> in the root of the project.<p class="paragraph"/>To change the version of your application you can edit the file manually, or run the <a href="../ref/Command Line/set-version.html" class="commandLine">set-version</a> command:<p class="paragraph"/><div class="code"><pre>grails set&#45;version 0.2</pre></div><p class="paragraph"/>The version is used in various commands including the <a href="../ref/Command Line/war.html" class="commandLine">war</a> command which will append the application version to the end of the created WAR file.<p class="paragraph"/><h4>Detecting Versions at Runtime</h4><p class="paragraph"/>You can detect the application version using Grails' support for application metadata using the <a href="../api/org/codehaus/groovy/grails/commons/GrailsApplication.html" class="api">GrailsApplication</a> class. For example within <a href="../guide/single.html#controllers" class="guide">controllers</a> there is an implicit <a href="../ref/Controllers/grailsApplication.html" class="controllers">grailsApplication</a> variable that can be used:<p class="paragraph"/><div class="code"><pre>def version = grailsApplication.metadata&#91;'app.version'&#93;</pre></div><p class="paragraph"/>You can retrieve the the version of Grails that is running with:<p class="paragraph"/><div class="code"><pre>def grailsVersion = grailsApplication.metadata&#91;'app.grails.version'&#93;</pre></div><p class="paragraph"/>or the <code>GrailsUtil</code> class:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> grails.util.GrailsUtil
&#8230;
def grailsVersion = GrailsUtil.grailsVersion</pre></div>


<a name="3.6 Project Documentation"><!-- Legacy link --></a>
<h2 id="docengine">4.6 Project Documentation</h2>
Since Grails 1.2, the documentation engine that powers the creation of this documentation has been available for your own Grails projects.<p class="paragraph"/>The documentation engine uses a variation on the <a href="http://textile.sitemonks.com/" target="blank">Textile</a> syntax to automatically create project documentation with smart linking, formatting etc.<p class="paragraph"/><h4>Creating project documentation</h4><p class="paragraph"/>To use the engine you need to follow a few conventions. First, you need to create a <code>src/docs/guide</code> directory where your documentation source files will go. Then, you need to create the source docs themselves. Each chapter should have its own gdoc file as should all numbered sub-sections. You will end up with something like:<p class="paragraph"/><div class="code"><pre>+ src/docs/guide/introduction.gdoc
+ src/docs/guide/introduction/changes.gdoc
+ src/docs/guide/gettingStarted.gdoc
+ src/docs/guide/configuration.gdoc
+ src/docs/guide/configuration/build.gdoc
+ src/docs/guide/configuration/build/controllers.gdoc</pre></div><p class="paragraph"/>Note that you can have all your gdoc files in the top-level directory if you want, but you can also put sub-sections in sub-directories named after the parent section - as the above example shows.<p class="paragraph"/>Once you have your source files, you still need to tell the documentation engine what the structure of your user guide is going to be. To do that, you add a <code>src/docs/guide/toc.yml</code> file that contains the structure and titles for each section. This file is in <a href="http://www.yaml.org/" target="blank">YAML</a> format and basically represents the structure of the user guide in tree form. For example, the above files could be represented as:<p class="paragraph"/><div class="code"><pre>introduction:
  title: Introduction
  changes: Change Log
gettingStarted: Getting Started
configuration:
  title: Configuration
  build:
    title: Build Config
    controllers: Specifying Controllers</pre></div><p class="paragraph"/>The format is pretty straightforward. Any section that has sub-sections is represented with the corresponding filename (minus the .gdoc extension) followed by a colon. The next line should contain <code>title:</code> plus the title of the section as seen by the end user. Every sub-section then has its own line after the title. Leaf nodes, i.e. those without any sub-sections, declare their title on the same line as the section name but after the colon.<p class="paragraph"/>That's it. You can easily add, remove, and move sections within the <code>toc.yml</code> to restructure the generated user guide. You should also make sure that all section names, i.e. the gdoc filenames, should be unique since they are used for creating internal links and for the HTML filenames. Don't worry though, the documentation engine will warn you of duplicate section names.<p class="paragraph"/><h4>Creating reference items</h4><p class="paragraph"/>Reference items appear in the Quick Reference section of the documentation. Each reference item belongs to a category and a category is a directory located in the <code>src/docs/ref</code> directory. For example, suppose you have defined a new controller method called <code>renderPDF</code>. That belongs to the <code>Controllers</code> category so you would create a gdoc text file at the following location:<p class="paragraph"/><div class="code"><pre>+ src/docs/ref/Controllers/renderPDF.gdoc</pre></div><p class="paragraph"/><h4>Configuring Output Properties</h4><p class="paragraph"/>There are various properties you can set within your <code>grails-app/conf/Config.groovy</code> file that customize the output of the documentation such as:
<ul class="star">
<li><strong class="bold">grails.doc.title</strong> - The title of the documentation</li>
<li><strong class="bold">grails.doc.subtitle</strong> - The subtitle of the documentation</li>
<li><strong class="bold">grails.doc.authors</strong> - The authors of the documentation</li>
<li><strong class="bold">grails.doc.license</strong> - The license of the software</li>
<li><strong class="bold">grails.doc.copyright</strong> - The copyright message to display</li>
<li><strong class="bold">grails.doc.footer</strong> - The footer to use</li>
</ul><p class="paragraph"/>Other properties such as the version are pulled from your project itself.  If a title is not specified, the application name is used.<p class="paragraph"/>You can also customise the look of the documentation and provide images by setting a few other options:
<ul class="star">
<li><strong class="bold">grails.doc.css</strong> - The location of a directory containing custom CSS files (type <code>java.io.File</code>)</li>
<li><strong class="bold">grails.doc.js</strong> - The location of a directory containing custom JavaScript files (type <code>java.io.File</code>)</li>
<li><strong class="bold">grails.doc.style</strong> - The location of a directory containing custom HTML templates for the guide (type <code>java.io.File</code>)</li>
<li><strong class="bold">grails.doc.images</strong> - The location of a directory containing image files for use in the style templates and within the documentation pages themselves (type <code>java.io.File</code>)</li>
</ul><p class="paragraph"/>One of the simplest ways to customise the look of the generated guide is to provide a value for <code>grails.doc.css</code> and then put a custom.css file in the corresponding directory. Grails will automatically include this CSS file in the guide. You can also place a custom-pdf.css file in that directory. This allows you to override the styles for the PDF version of the guide.<p class="paragraph"/><h4>Generating Documentation</h4><p class="paragraph"/>Once you have created some documentation (refer to the syntax guide in the next chapter) you can generate an HTML version of the documentation using the command:<p class="paragraph"/><div class="code"><pre>grails doc</pre></div><p class="paragraph"/>This command will output an <code>docs/manual/index.html</code> which can be opened in a browser to view your documentation.<p class="paragraph"/><h4>Documentation Syntax</h4><p class="paragraph"/>As mentioned the syntax is largely similar to Textile or Confluence style wiki markup. The following sections walk you through the syntax basics.<p class="paragraph"/><h5>Basic Formatting</h5><p class="paragraph"/>Monospace: <code>monospace</code>
<div class="code"><pre>&#64;monospace&#64;</pre></div><p class="paragraph"/>Italic:  <em class="italic">italic</em> 
<div class="code"><pre>&#95;italic&#95;</pre></div><p class="paragraph"/>Bold: <strong class="bold">bold</strong>
<div class="code"><pre>&#42;bold&#42;</pre></div><p class="paragraph"/>Image:
<img border="0" class="center" src="http://grails.org/images/new/grailslogo_topNav.png"></img><p class="paragraph"/><div class="code"><pre>&#33;http://grails.org/images/new/grailslogo_topNav.png&#33;</pre></div><p class="paragraph"/>You can also link to internal images like so:<p class="paragraph"/><div class="code"><pre>&#33;someFolder/my_diagram.png&#33;</pre></div><p class="paragraph"/>This will link to an image stored locally within your project. There is currently no default location for doc images, but you can specify one with the <code>grails.doc.images</code> setting in Config.groovy like so:<p class="paragraph"/><div class="code"><pre>grails.doc.images = <span class="java&#45;keyword">new</span> File(<span class="java&#45;quote">"src/docs/images"</span>)</pre></div><p class="paragraph"/>In this example, you would put the my_diagram.png file in the directory 'src/docs/images/someFolder'.<p class="paragraph"/><h5>Linking</h5><p class="paragraph"/>There are several ways to create links with the documentation generator. A basic external link can either be defined using confluence or textile style markup:<p class="paragraph"/><div class="code"><pre>&#91;SpringSource|http://www.springsource.com/&#93;</pre></div><p class="paragraph"/>or<p class="paragraph"/><div class="code"><pre><span class="java&#45;quote">"SpringSource"</span>:http://www.springsource.com/</pre></div><p class="paragraph"/>For links to other sections inside the user guide you can use the <code>guide:</code> prefix with the name of the section you want to link to:<p class="paragraph"/><div class="code"><pre>&#91;Intro|guide:introduction&#93;</pre></div><p class="paragraph"/>The section name comes from the corresponding gdoc filename. The documentation engine will warn you if any links to sections in your guide break.<p class="paragraph"/>To link to reference items you can use a special syntax:<p class="paragraph"/><div class="code"><pre>&#91;controllers|renderPDF&#93;</pre></div><p class="paragraph"/>In this case the category of the reference item is on the left hand side of the | and the name of the reference item on the right.<p class="paragraph"/>Finally, to link to external APIs you can use the <code>api:</code> prefix. For example:<p class="paragraph"/><div class="code"><pre>&#91;<span class="java&#45;object">String</span>|api:java.lang.<span class="java&#45;object">String</span>&#93;</pre></div><p class="paragraph"/>The documentation engine will automatically create the appropriate javadoc link in this case. To add additional APIs to the engine you can configure them in <code>grails-app/conf/Config.groovy</code>. For example:<p class="paragraph"/><div class="code"><pre>grails.doc.api.org.hibernate=
            <span class="java&#45;quote">"http://docs.jboss.org/hibernate/stable/core/javadocs"</span></pre></div><p class="paragraph"/>The above example configures classes within the <code>org.hibernate</code> package to link to the Hibernate website's API docs.<p class="paragraph"/><h5>Lists and Headings</h5><p class="paragraph"/>Headings can be created by specifying the letter 'h' followed by a number and then a dot:<p class="paragraph"/><div class="code"><pre>h3.&#60;space&#62;Heading3
h4.&#60;space&#62;Heading4</pre></div><p class="paragraph"/>Unordered lists are defined with the use of the * character:<p class="paragraph"/><div class="code"><pre>&#42; item 1
&#42;&#42; subitem 1
&#42;&#42; subitem 2
&#42; item 2</pre></div><p class="paragraph"/>Numbered lists can be defined with the # character:<p class="paragraph"/><div class="code"><pre>&#35; item 1</pre></div><p class="paragraph"/>Tables can be created using the <code>table</code> macro:<p class="paragraph"/><table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th><strong class="bold">Name</strong></th><th><strong class="bold">Number</strong></th></tr><tr class="table-odd"><td>Albert</td><td>46</td></tr><tr class="table-even"><td>Wilma</td><td>1348</td></tr><tr class="table-odd"><td>James</td><td>12</td></tr></table><p class="paragraph"/><div class="code"><pre>&#123;table&#125;
 &#42;Name&#42; | &#42;<span class="java&#45;object">Number</span>&#42;
 Albert | 46
 Wilma | 1348
 James | 12
&#123;table&#125;</pre></div><p class="paragraph"/><h5>Code and Notes</h5><p class="paragraph"/>You can define code blocks with the <code>code</code> macro:<p class="paragraph"/><div class="code"><pre>class Book &#123;
    <span class="java&#45;object">String</span> title
&#125;</pre></div><p class="paragraph"/><div class="code"><pre>&#123;code&#125;
class Book &#123;
    <span class="java&#45;object">String</span> title
&#125;
&#123;code&#125;</pre></div><p class="paragraph"/>The example above provides syntax highlighting for Java and Groovy code, but you can also highlight XML markup:<p class="paragraph"/><div class="code"><pre><span class="xml&#45;tag">&#60;hello&#62;</span>world<span class="xml&#45;tag">&#60;/hello&#62;</span></pre></div><p class="paragraph"/><div class="code"><pre>&#123;code:xml&#125;
&#60;hello&#62;world&#60;/hello&#62;
&#123;code&#125;</pre></div><p class="paragraph"/>There are also a couple of macros for displaying notes and warnings:<p class="paragraph"/>Note:
<blockquote class="note">
This is a note!
</blockquote><p class="paragraph"/><div class="code"><pre>&#123;note&#125;
This is a note!
&#123;note&#125;</pre></div><p class="paragraph"/>Warning:<p class="paragraph"/><blockquote class="warning">
This is a warning!
</blockquote><p class="paragraph"/><div class="code"><pre>&#123;warning&#125;
This is a warning!
&#123;warning&#125;</pre></div>


<a name="3.7 Dependency Resolution"><!-- Legacy link --></a>
<h2 id="ivy">4.7 Dependency Resolution</h2>
Grails features a dependency resolution DSL that lets you control how plugins and JAR dependencies are resolved.<p class="paragraph"/>You specify a <code>grails.project.dependency.resolution</code> property inside the <code>grails-app/conf/BuildConfig.groovy</code> file that configures how dependencies are resolved:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
   // config here
&#125;</pre></div><p class="paragraph"/>The default configuration looks like the following:<p class="paragraph"/><div class="code"><pre>grails.project.class.dir = <span class="java&#45;quote">"target/classes"</span>
grails.project.test.class.dir = <span class="java&#45;quote">"target/test&#45;classes"</span>
grails.project.test.reports.dir = <span class="java&#45;quote">"target/test&#45;reports"</span>
//grails.project.war.file = <span class="java&#45;quote">"target/&#36;&#123;appName&#125;&#45;&#36;&#123;appVersion&#125;.war"</span><p class="paragraph"/>grails.project.dependency.resolution = &#123;
    // inherit Grails' <span class="java&#45;keyword">default</span> dependencies
    inherits(<span class="java&#45;quote">"global"</span>) &#123;
        // uncomment to disable ehcache
        // excludes 'ehcache'
    &#125;
    log <span class="java&#45;quote">"warn"</span>
    repositories &#123;
        grailsPlugins()
        grailsHome()
        grailsCentral()<p class="paragraph"/>        // uncomment these to enable remote dependency resolution
        // from <span class="java&#45;keyword">public</span> Maven repositories
        //mavenCentral()
        //mavenLocal()
        //mavenRepo <span class="java&#45;quote">"http://snapshots.repository.codehaus.org"</span>
        //mavenRepo <span class="java&#45;quote">"http://repository.codehaus.org"</span>
        //mavenRepo <span class="java&#45;quote">"http://download.java.net/maven/2/"</span>
        //mavenRepo <span class="java&#45;quote">"http://repository.jboss.com/maven2/"</span>
    &#125;
    dependencies &#123;
        // specify dependencies here under either 'build', 'compile',
        // 'runtime', 'test' or 'provided' scopes eg.<p class="paragraph"/>        // runtime 'mysql:mysql&#45;connector&#45;java:5.1.16'
    &#125;<p class="paragraph"/>    plugins &#123;
        compile <span class="java&#45;quote">"&#58;hibernate:&#36;grailsVersion"</span>
        compile <span class="java&#45;quote">"&#58;jquery:1.6.1.1"</span>
        compile <span class="java&#45;quote">"&#58;resources:1.0"</span><p class="paragraph"/>        build <span class="java&#45;quote">"&#58;tomcat:&#36;grailsVersion"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>The details of the above will be explained in the next few sections.<p class="paragraph"/>

<a name="3.7.1 Configurations and Dependencies"><!-- Legacy link --></a>
<h2 id="configurationsAndDependencies">4.7.1 Configurations and Dependencies</h2>
Grails features five dependency resolution configurations (or 'scopes'):
<ul class="star">
<li> <code>build</code>: Dependencies for the build system only</li>
<li> <code>compile</code>: Dependencies for the compile step</li>
<li> <code>runtime</code>: Dependencies needed at runtime but not for compilation (see above)</li>
<li> <code>test</code>: Dependencies needed for testing but not at runtime (see above)</li>
<li> <code>provided</code>: Dependencies needed at development time, but not during WAR deployment</li>
</ul><p class="paragraph"/>Within the <code>dependencies</code> block you can specify a dependency that falls into one of these configurations by calling the equivalent method. For example if your application requires the MySQL driver to function at <code>runtime</code> you can specify that like this:<p class="paragraph"/><div class="code"><pre>runtime 'com.mysql:mysql&#45;connector&#45;java:5.1.16'</pre></div><p class="paragraph"/>This uses the string syntax: <code>group:name:version</code>. You can also use a Map-based syntax:<p class="paragraph"/><div class="code"><pre>runtime group: 'com.mysql',
        name: 'mysql&#45;connector&#45;java',
        version: '5.1.16'</pre></div><p class="paragraph"/>In Maven terminology, <code>group</code> corresponds to an artifact's <code>groupId</code> and <code>name</code> corresponds to its <code>artifactId</code>.<p class="paragraph"/>Multiple dependencies can be specified by passing multiple arguments:<p class="paragraph"/><div class="code"><pre>runtime 'com.mysql:mysql&#45;connector&#45;java:5.1.16',
        'net.sf.ehcache:ehcache:1.6.1'<p class="paragraph"/>// Or<p class="paragraph"/>runtime(
    &#91;group:'com.mysql', name:'mysql&#45;connector&#45;java', version:'5.1.16'&#93;,
    &#91;group:'net.sf.ehcache', name:'ehcache', version:'1.6.1'&#93;
)</pre></div><p class="paragraph"/><h3>Disabling transitive dependency resolution</h3><p class="paragraph"/>By default, Grails will not only get the JARs and plugins that you declare, but it will also get their transitive dependencies. This is usually what you want, but there are occasions where you want a dependency without all its baggage. In such cases, you can disable transitive dependency resolution on a case-by-case basis:<p class="paragraph"/><div class="code"><pre>runtime('com.mysql:mysql&#45;connector&#45;java:5.1.16',
        'net.sf.ehcache:ehcache:1.6.1') &#123;
    transitive = <span class="java&#45;keyword">false</span>
&#125;<p class="paragraph"/>// Or
runtime group:'com.mysql',
        name:'mysql&#45;connector&#45;java',
        version:'5.1.16',
        transitive:<span class="java&#45;keyword">false</span></pre></div><p class="paragraph"/><h3>Excluding specific transitive dependencies</h3><p class="paragraph"/>A far more common scenario is where you want the transitive dependencies, but some of them cause issues with your own dependencies or are unnecessary. For example, many Apache projects have 'commons-logging' as a transitive dependency, but it shouldn't be included in a Grails project (we use SLF4J). That's where the <code>excludes</code> option comes in:<p class="paragraph"/><div class="code"><pre>runtime('com.mysql:mysql&#45;connector&#45;java:5.1.16',
        'net.sf.ehcache:ehcache:1.6.1') &#123;
    excludes <span class="java&#45;quote">"xml&#45;apis"</span>, <span class="java&#45;quote">"commons&#45;logging"</span>
&#125;<p class="paragraph"/>// Or
runtime(group:'com.mysql', name:'mysql&#45;connector&#45;java', version:'5.1.16') &#123;
    excludes(&#91; group: 'xml&#45;apis', name: 'xml&#45;apis'&#93;,
             &#91; group: 'org.apache.httpcomponents' &#93;,
             &#91; name: 'commons&#45;logging' &#93;)</pre></div><p class="paragraph"/>As you can see, you can either exclude dependencies by their artifact ID (also known as a module name) or any combination of group and artifact IDs (if you use the Map notation). You may also come across <code>exclude</code> as well, but that can only accept a single string or Map:<p class="paragraph"/><div class="code"><pre>runtime('com.mysql:mysql&#45;connector&#45;java:5.1.16',
        'net.sf.ehcache:ehcache:1.6.1') &#123;
    exclude <span class="java&#45;quote">"xml&#45;apis"</span>
&#125;</pre></div><p class="paragraph"/><h3>Using Ivy module configurations</h3><p class="paragraph"/>If you use Ivy module configurations and wish to depend on a specific configuration of a module, you can use the <code>dependencyConfiguration</code> method to specify the configuration to use.<p class="paragraph"/><div class="code"><pre>provided(<span class="java&#45;quote">"my.org:web&#45;service:1.0"</span>) &#123;
    dependencyConfiguration <span class="java&#45;quote">"api"</span>
&#125;</pre></div><p class="paragraph"/>If the dependency configuration is not explicitly set, the configuration named <code>"default"</code> will be used (which is also the correct value for dependencies coming from Maven style repositories).<p class="paragraph"/><h3>Where are the JARs?</h3><p class="paragraph"/>With all these declarative dependencies, you may wonder where all the JARs end up. They have to go somewhere after all. By default Grails puts them into a directory, called the dependency cache, that resides on your local file system at <code>user.home</code>/.grails/ivy-cache. You can change this either via the <code>settings.groovy</code> file:<p class="paragraph"/><div class="code"><pre>grails.dependency.cache.dir = <span class="java&#45;quote">"$&#123;userHome&#125;/.my&#45;dependency&#45;cache"</span></pre></div><p class="paragraph"/>or in the dependency DSL:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    &#8230;
    cacheDir <span class="java&#45;quote">"target/ivy&#45;cache"</span>
    &#8230;
&#125;</pre></div><p class="paragraph"/>The <code>settings.groovy</code> option applies to all projects, so it's the preferred approach.


<a name="3.7.2 Dependency Repositories"><!-- Legacy link --></a>
<h2 id="dependencyRepositories">4.7.2 Dependency Repositories</h2>
<h4>Remote Repositories</h4><p class="paragraph"/>Initially your BuildConfig.groovy does not use any remote public Maven repositories. There is a default <code>grailsHome()</code> repository that will locate the JAR files Grails needs from your Grails installation. To use a public repository, specify it in the <code>repositories</code> block:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    mavenCentral()
&#125;</pre></div><p class="paragraph"/>In this case the default public Maven repository is specified. To use the SpringSource Enterprise Bundle Repository you can use the <code>ebr()</code> method:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    ebr()
&#125;</pre></div><p class="paragraph"/>You can also specify a specific Maven repository to use by URL:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    mavenRepo <span class="java&#45;quote">"http://repository.codehaus.org"</span>
&#125;</pre></div><p class="paragraph"/>and even give it a name:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    mavenRepo name: <span class="java&#45;quote">"Codehaus"</span>, root: <span class="java&#45;quote">"http://repository.codehaus.org"</span>
&#125;</pre></div><p class="paragraph"/>so that you can easily identify it in logs.<p class="paragraph"/><h4>Controlling Repositories Inherited from Plugins</h4><p class="paragraph"/>A plugin you have installed may define a reference to a remote repository just as an application can. By default your application will inherit this repository definition when you install the plugin.<p class="paragraph"/>If you do not wish to inherit repository definitions from plugins then you can disable repository inheritance:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    inherit <span class="java&#45;keyword">false</span>
&#125;</pre></div><p class="paragraph"/>In this case your application will not inherit any repository definitions from plugins and it is down to you to provide appropriate (possibly internal) repository definitions.<p class="paragraph"/><h4>Offline Mode</h4><p class="paragraph"/>There are times when it is not desirable to connect to any remote repositories (whilst working on the train for example!). In this case you can use the <code>offline</code> flag to execute Grails commands and Grails will not connect to any remote repositories:<p class="paragraph"/><div class="code"><pre>grails &#45;&#45;offline run&#45;app</pre></div><p class="paragraph"/><blockquote class="note">
Note that this command will fail if you do not have the necessary dependencies in your local Ivy cache
</blockquote><p class="paragraph"/>You can also globally configure offline mode by setting <code>grails.offline.mode</code> to <code>true</code> in <code>~/.grails/settings.groovy</code> or in your project's <code>BuildConfig.groovy</code> file:<p class="paragraph"/><div class="code"><pre>grails.offline.mode=<span class="java&#45;keyword">true</span></pre></div><p class="paragraph"/><h4>Local Resolvers</h4><p class="paragraph"/>If you do not wish to use a public Maven repository you can specify a flat file repository:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    flatDir name:'myRepo', dirs:'/path/to/repo'
&#125;</pre></div><p class="paragraph"/>To specify your local Maven cache (<code>~/.m2/repository</code>) as a repository:<p class="paragraph"/><div class="code"><pre>repositories &#123;
    mavenLocal()
&#125;</pre></div>
<h4>Custom Resolvers</h4><p class="paragraph"/>If all else fails since Grails builds on Apache Ivy you can specify an Ivy resolver:<p class="paragraph"/><div class="code"><pre>/&#42;
 &#42; Configure our resolver.
 &#42;/
def libResolver = <span class="java&#45;keyword">new</span> org.apache.ivy.plugins.resolver.URLResolver()
&#91;'libraries', 'builds'&#93;.each &#123;<p class="paragraph"/>    libResolver.addArtifactPattern(
            <span class="java&#45;quote">"http://my.repository/&#36;&#123;it&#125;/"</span> +
            <span class="java&#45;quote">"&#91;organisation&#93;/&#91;module&#93;/&#91;revision&#93;/&#91;type&#93;s/&#91;artifact&#93;.&#91;ext&#93;"</span>)<p class="paragraph"/>    libResolver.addIvyPattern(
            <span class="java&#45;quote">"http://my.repository/&#36;&#123;it&#125;/"</span> +
            <span class="java&#45;quote">"&#91;organisation&#93;/&#91;module&#93;/&#91;revision&#93;/&#91;type&#93;s/&#91;artifact&#93;.&#91;ext&#93;"</span>)
&#125;<p class="paragraph"/>libResolver.name = <span class="java&#45;quote">"my&#45;repository"</span>
libResolver.settings = ivySettings<p class="paragraph"/>resolver libResolver</pre></div><p class="paragraph"/>It's also possible to pull dependencies from a repository using SSH. Ivy comes with a dedicated resolver that you can configure and include in your project like so:
<div class="code"><pre><span class="java&#45;keyword">import</span> org.apache.ivy.plugins.resolver.SshResolver
&#8230;
repositories &#123;
    ...<p class="paragraph"/>    def sshResolver = <span class="java&#45;keyword">new</span> SshResolver(
            name: <span class="java&#45;quote">"myRepo"</span>,
            user: <span class="java&#45;quote">"username"</span>,
            host: <span class="java&#45;quote">"dev.x.com"</span>,
            keyFile: <span class="java&#45;keyword">new</span> File(<span class="java&#45;quote">"/home/username/.ssh/id_rsa"</span>),
            m2compatible: <span class="java&#45;keyword">true</span>)<p class="paragraph"/>    sshResolver.addArtifactPattern(
            <span class="java&#45;quote">"/home/grails/repo/&#91;organisation&#93;/&#91;artifact&#93;/"</span> +
            <span class="java&#45;quote">"&#91;revision&#93;/&#91;artifact&#93;&#45;&#91;revision&#93;.&#91;ext&#93;"</span>)<p class="paragraph"/>    sshResolver.latestStrategy =
            <span class="java&#45;keyword">new</span> org.apache.ivy.plugins.latest.LatestTimeStrategy()<p class="paragraph"/>    sshResolver.changingPattern = <span class="java&#45;quote">".&#42;SNAPSHOT"</span><p class="paragraph"/>    sshResolver.setCheckmodified(<span class="java&#45;keyword">true</span>)<p class="paragraph"/>    resolver sshResolver
&#125;</pre></div><p class="paragraph"/>Download the <a href="http://www.jcraft.com/jsch/" target="blank">JSch</a> JAR and add it to Grails' classpath to use the SSH resolver. You can do this by passing the path in the Grails command line:
<div class="code"><pre>grails &#45;classpath /path/to/jsch compile|run&#45;app|etc.</pre></div><p class="paragraph"/>You can also add its path to the <code>CLASSPATH</code> environment variable but be aware this it affects many Java applications. An alternative on Unix is to create an alias for <code>grails -classpath ...</code> so that you don't have to type the extra arguments each time.<p class="paragraph"/><h4>Authentication</h4><p class="paragraph"/>If your repository requires authentication you can configure this using a <code>credentials</code> block:<p class="paragraph"/><div class="code"><pre>credentials &#123;
    realm = <span class="java&#45;quote">".."</span>
    host = <span class="java&#45;quote">"localhost"</span>
    username = <span class="java&#45;quote">"myuser"</span>
    password = <span class="java&#45;quote">"mypass"</span>
&#125;</pre></div><p class="paragraph"/>This can be placed in your <code>USER_HOME/.grails/settings.groovy</code> file using the <code>grails.project.ivy.authentication</code> setting:<p class="paragraph"/><div class="code"><pre>grails.project.ivy.authentication = &#123;
    credentials &#123;
        realm = <span class="java&#45;quote">".."</span>
        host = <span class="java&#45;quote">"localhost"</span>
        username = <span class="java&#45;quote">"myuser"</span>
        password = <span class="java&#45;quote">"mypass"</span>
    &#125;
&#125;</pre></div>


<a name="3.7.3 Debugging Resolution"><!-- Legacy link --></a>
<h2 id="debuggingResolution">4.7.3 Debugging Resolution</h2>
If you are having trouble getting a dependency to resolve you can enable more verbose debugging from the underlying engine using the <code>log</code> method:<p class="paragraph"/><div class="code"><pre>// log level of Ivy resolver, either 'error', 'warn',
// 'info', 'debug' or 'verbose'
log <span class="java&#45;quote">"warn"</span></pre></div><p class="paragraph"/>A common issue is that the checksums for a dependency don't match the associated JAR file, and so Ivy rejects the dependency. This helps ensure that the dependencies are valid. But for a variety of reasons some dependencies simply don't have valid checksums in the repositories, even if they are valid JARs. To get round this, you can disable Ivy's dependency checks like so:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    &#8230;
    log <span class="java&#45;quote">"warn"</span>
    checksums <span class="java&#45;keyword">false</span>
    &#8230;
&#125;</pre></div><p class="paragraph"/>This is a global setting, so only use it if you have to.


<a name="3.7.4 Inherited Dependencies"><!-- Legacy link --></a>
<h2 id="inheritedDependencies">4.7.4 Inherited Dependencies</h2>
By default every Grails application inherits several framework dependencies. This is done through the line:<p class="paragraph"/><div class="code"><pre>inherits <span class="java&#45;quote">"global"</span></pre></div><p class="paragraph"/>Inside the <code>BuildConfig.groovy</code> file. To exclude specific inherited dependencies you use the <code>excludes</code> method:<p class="paragraph"/><div class="code"><pre>inherits(<span class="java&#45;quote">"global"</span>) &#123;
    excludes <span class="java&#45;quote">"oscache"</span>, <span class="java&#45;quote">"ehcache"</span>
&#125;</pre></div>


<a name="3.7.5 Providing Default Dependencies"><!-- Legacy link --></a>
<h2 id="providingDefaultDependencies">4.7.5 Providing Default Dependencies</h2>
Most Grails applications have runtime dependencies on several jar files that are provided by the Grails framework.  These include libraries like Spring, Sitemesh, Hibernate etc.  When a war file is created, all of these dependencies will be included in it.  But, an application may choose to exclude these jar files from the war.  This is useful when the jar files will be provided by the container, as would normally be the case if multiple Grails applications are deployed to the same container.<p class="paragraph"/>The dependency resolution DSL provides a mechanism to express that all of the default dependencies will be provided by the container. This is done by invoking the <code>defaultDependenciesProvided</code> method and passing <code>true</code> as an argument:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;<p class="paragraph"/>    defaultDependenciesProvided <span class="java&#45;keyword">true</span> // all of the <span class="java&#45;keyword">default</span> dependencies will
                                     // be <span class="java&#45;quote">"provided"</span> by the container<p class="paragraph"/>    inherits <span class="java&#45;quote">"global"</span> // inherit Grails' <span class="java&#45;keyword">default</span> dependencies<p class="paragraph"/>    repositories &#123;
        grailsHome()
        &#8230;
    &#125;
    dependencies &#123;
        &#8230;
    &#125;
&#125;</pre></div><p class="paragraph"/><blockquote class="note">
<code>defaultDependenciesProvided</code> must come before <code>inherits</code>, otherwise the Grails dependencies will be included in the war.
</blockquote>


<a name="3.7.11 Changing/Snapshot Dependencies"><!-- Legacy link --></a>
<h2 id="changingDependencies">4.7.6 Snapshots and Other Changing Dependencies</h2>
Typically, dependencies are constant. That is, for a given combination of <code>group</code>, <code>name</code> and <code>version</code> the jar (or plugin) that it refers to will never change. The Grails dependency management system uses this fact to cache dependencies in order to avoid having to download them from the source repository each time. Sometimes this is not desirable. For example, many developers use the convention of a  <em class="italic">snapshot</em>  (i.e. a dependency with a version number ending in “-SNAPSHOT”) that can change from time to time while still retaining the same version number. We call this a "changing dependency".<p class="paragraph"/>Whenever you have a changing dependency, Grails will always check the remote repository for a new version. More specifically, when a changing dependency is encountered during dependency resolution its last modified timestamp in the local cache is compared against the last modified timestamp in the dependency repositories. If the version on the remote server is deemed to be newer than the version in the local cache, the new version will be downloaded and used.<p class="paragraph"/>{info}
Be sure to read the next section on “Dependency Resolution Caching” in addition to this one as it affects changing dependencies.
{info}<p class="paragraph"/>All dependencies (jars and plugins) with a version number ending in <code>-SNAPSHOT</code> are <strong class="bold">implicitly</strong> considered to be changing by Grails. You can also explicitly specify that a dependency is changing by setting the changing flag in the dependency DSL:<p class="paragraph"/><div class="code"><pre>runtime ('org.my:lib:1.2.3') &#123;
    changing = <span class="java&#45;keyword">true</span>
&#125;</pre></div><p class="paragraph"/>There is a caveat to the support for changing dependencies that you should be aware of. Grails will stop looking for newer versions of a dependency once it finds a remote repository that has the dependency.<p class="paragraph"/>Consider the following setup:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    repositories &#123;
        mavenLocal()
        mavenRepo <span class="java&#45;quote">"http://my.org/repo"</span>
    &#125;
    dependencies &#123;
        compile <span class="java&#45;quote">"myorg:mylib:1.0&#45;SNAPSHOT"</span>
    &#125;</pre></div><p class="paragraph"/>In this example we are using the local maven repository and a remote network maven repository. Assuming that the local Grails dependency and the local Maven cache do not contain the dependency but the remote repository does, when we perform dependency resolution the following actions will occur:
<ul class="star">
<li>maven local repository is searched, dependency not found</li>
<li>maven network repository is searched, dependency is downloaded to the cache and used</li>
</ul><p class="paragraph"/>Note that the repositories are checked in the order they are defined in the <code>BuildConfig.groovy</code> file.<p class="paragraph"/>If we perform dependency resolution again without the dependency changing on the remote server, the following will happen:
<ul class="star">
<li>maven local repository is searched, dependency not found</li>
<li>maven network repository is searched, dependency is found to be the same “age” as the version in the cache so will not be updated (i.e. downloaded)</li>
</ul><p class="paragraph"/>Later on, a new version of <code>mylib 1.0-SNAPSHOT</code> is published changing the version on the server. The next time we perform dependency resolution, the following will happen:
<ul class="star">
<li>maven local repository is searched, dependency not found</li>
<li>maven network repository is searched, dependency is found to newer than version in the cache so will be updated (i.e. downloaded to the cache)</li>
</ul><p class="paragraph"/>So far everything is working well.<p class="paragraph"/>Now we want to test some local changes to the <code>mylib</code> library. To do this we build it locally and install it to the local Maven cache (how doesn't particularly matter). The next time we perform a dependency resolution, the following will occur:
<ul class="star">
<li>maven local repository is searched, dependency is found to newer than version in the cache so will be updated (i.e. downloaded to the cache)</li>
<li>maven network repository is NOT searched as we've already found the dependency</li>
</ul><p class="paragraph"/>This is what we wanted to occur.<p class="paragraph"/>Later on, a new version of <code>mylib 1.0-SNAPSHOT</code> is published changing the version on the server. The next time we perform dependency resolution, the following will happen:
<ul class="star">
<li>maven local repository is searched, dependency is found to be the same “age” as the version in the cache so will not be updated (i.e. downloaded)</li>
<li>maven network repository is NOT searched as we've already found the dependency</li>
</ul><p class="paragraph"/>This is likely to not be the desired outcome. We are now out of sync with the latest published snapshot and will continue to keep using the version from the local maven repository.<p class="paragraph"/>The rule to remember is this: when resolving a dependency, Grails will stop searching as soon as it finds a repository that has the dependency at the specified version number. It will <strong class="bold">not</strong> continue searching all repositories trying to find a more recently modified instance.<p class="paragraph"/>To remedy this situation (i.e. build against the  <em class="italic">newer</em>  version of <code>mylib 1.0-SNAPSHOT</code> in the remote repository), you can either:
<ul class="star">
<li>Delete the version from the local maven repository, or</li>
<li>Reorder the repositories in the <code>BuildConfig.groovy</code> file</li>
</ul><p class="paragraph"/>Where possible, prefer deleting the version from the local maven repository. In general, when you have finished building against a locally built SNAPSHOT always try to clear it from the local maven repository.<p class="paragraph"/><blockquote class="note">
This changing dependency behaviour is an unmodifiable characteristic of the underlying dependency management system that Grails uses, Apache Ivy. It is currently not possible to have Ivy search all repositories to look for newer versions (in terms of modification date) of the same dependency (i.e. the same combination of <code>group</code>, <code>name</code> and <code>version</code>).
</blockquote>


<a name="3.7.6 Dependency Reports"><!-- Legacy link --></a>
<h2 id="dependencyReports">4.7.7 Dependency Reports</h2>
As mentioned in the previous section a Grails application consists of dependencies inherited from the framework, the plugins installed and the application dependencies itself.<p class="paragraph"/>To obtain a report of an application's dependencies you can run the <a href="../ref/Command Line/dependency-report.html" class="commandLine">dependency-report</a> command:<p class="paragraph"/><div class="code"><pre>grails dependency&#45;report</pre></div><p class="paragraph"/>By default this will generate reports in the <code>target/dependency-report</code> directory. You can specify which configuration (scope) you want a report for by passing an argument containing the configuration name:<p class="paragraph"/><div class="code"><pre>grails dependency&#45;report runtime</pre></div>


<a name="3.7.7 Plugin JAR Dependencies"><!-- Legacy link --></a>
<h2 id="pluginJARDependencies">4.7.8 Plugin JAR Dependencies</h2>
<h4>Specifying Plugin JAR dependencies</h4><p class="paragraph"/>The way in which you specify dependencies for a <a href="../guide/single.html#plugins" class="guide">plugin</a> is identical to how you specify dependencies in an application. When a plugin is installed into an application the application automatically inherits the dependencies of the plugin.<p class="paragraph"/>To define a dependency that is resolved for use with the plugin but not  <em class="italic">exported</em>  to the application then you can set the <code>export</code> property of the dependency:<p class="paragraph"/><div class="code"><pre>test('org.spockframework:spock&#45;core:0.5&#45;groovy&#45;1.8') &#123;
    export = <span class="java&#45;keyword">false</span>
&#125;</pre></div><p class="paragraph"/>In this case the Spock dependency will be available only to the plugin and not resolved as an application dependency. Alternatively, if you're using the Map syntax:<p class="paragraph"/><div class="code"><pre>test group: 'org.spockframework', name: 'spock&#45;core',
     version: '0.5&#45;groovy&#45;1.8', export: <span class="java&#45;keyword">false</span></pre></div><p class="paragraph"/><blockquote class="note">
You can use <code>exported = false</code> instead of <code>export = false</code>, but we recommend the latter because it's consistent with the Map argument.
</blockquote><p class="paragraph"/><h4>Overriding Plugin JAR Dependencies in Your Application</h4><p class="paragraph"/>If a plugin is using a JAR which conflicts with another plugin, or an application dependency then you can override how a plugin resolves its dependencies inside an application using exclusions. For example:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    compile(<span class="java&#45;quote">"&#58;hibernate&#58;&#36;grailsVersion"</span>) &#123;
        excludes <span class="java&#45;quote">"javassist"</span>
    &#125;
&#125;<p class="paragraph"/>dependencies &#123;
    runtime <span class="java&#45;quote">"javassist:javassist:3.4.GA"</span>
&#125;</pre></div><p class="paragraph"/>In this case the application explicitly declares a dependency on the "hibernate" plugin and specifies an exclusion using the <code>excludes</code> method, effectively excluding the javassist library as a dependency.


<a name="3.7.8 Maven Integration"><!-- Legacy link --></a>
<h2 id="mavenIntegration">4.7.9 Maven Integration</h2>
When using the Grails Maven plugin, Grails' dependency resolution mechanics are disabled as it is assumed that you will manage dependencies with Maven's <code>pom.xml</code> file.<p class="paragraph"/>However, if you would like to continue using Grails regular commands like <a href="../ref/Command Line/run-app.html" class="commandLine">run-app</a>, <a href="../ref/Command Line/test-app.html" class="commandLine">test-app</a> and so on then you can tell Grails' command line to load dependencies from the Maven <code>pom.xml</code> file instead.<p class="paragraph"/>To do so simply add the following line to your <code>BuildConfig.groovy</code>:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    pom <span class="java&#45;keyword">true</span>
    ..
&#125;</pre></div><p class="paragraph"/>The line <code>pom true</code> tells Grails to parse Maven's <code>pom.xml</code> and load dependencies from there.


<a name="3.7.9 Deploying to a Maven Repository"><!-- Legacy link --></a>
<h2 id="mavendeploy">4.7.10 Deploying to a Maven Repository</h2>
If you use Maven to build your Grails project, you can use the standard Maven targets <code>mvn install</code> and <code>mvn deploy</code>.
If not, you can deploy a Grails project or plugin to a Maven repository using the <a href="http://grails.org/plugin/maven-publisher" target="blank">maven-publisher</a> plugin.<p class="paragraph"/>The plugin provides the ability to publish Grails projects and plugins to local and remote Maven repositories. There are two key additional targets added by the plugin:
<ul class="star">
<li><strong class="bold">maven-install</strong> - Installs a Grails project or plugin into your local Maven cache</li>
<li><strong class="bold">maven-deploy</strong> - Deploys a Grails project or plugin to a remote Maven repository</li>
</ul><p class="paragraph"/>By default this plugin will automatically generate a valid <code>pom.xml</code> for you unless a <code>pom.xml</code> is already present in the root of the project, in which case this <code>pom.xml</code> file will be used.<p class="paragraph"/><h4>maven-install</h4><p class="paragraph"/>The <code>maven-install</code> command will install the Grails project or plugin artifact into your local Maven cache:<p class="paragraph"/><div class="code"><pre>grails maven&#45;install</pre></div><p class="paragraph"/>In the case of plugins, the plugin zip file will be installed, whilst for application the application WAR file will be installed.<p class="paragraph"/><h4>maven-deploy</h4><p class="paragraph"/>The <code>maven-deploy</code> command will deploy a Grails project or plugin into a remote Maven repository:<p class="paragraph"/><div class="code"><pre>grails maven&#45;deploy</pre></div><p class="paragraph"/>It is assumed that you have specified the necessary <code>&#60;distributionManagement&#62;</code> configuration within a <code>pom.xml</code> or that you specify the <code>id</code> of the remote repository to deploy to:<p class="paragraph"/><div class="code"><pre>grails maven&#45;deploy &#45;&#45;repository=myRepo</pre></div><p class="paragraph"/>The <code>repository</code> argument specifies the 'id' for the repository. Configure the details of the repository specified by this 'id' within your <code>grails-app/conf/BuildConfig.groovy</code> file or in your <code>$USER_HOME/.grails/settings.groovy</code> file:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.distribution = &#123;
    localRepository = <span class="java&#45;quote">"/path/to/my/local"</span>
    remoteRepository(id: <span class="java&#45;quote">"myRepo"</span>, url: <span class="java&#45;quote">"http://myserver/path/to/repo"</span>)
&#125;</pre></div><p class="paragraph"/>The syntax for configuring remote repositories matches the syntax from the <a href="http://maven.apache.org/ant-tasks/reference.html#remoteRepository" target="blank">remoteRepository</a> element in the Ant Maven tasks. For example the following XML:<p class="paragraph"/><div class="code"><pre>&#60;remoteRepository id=<span class="java&#45;quote">"myRepo"</span> url=<span class="java&#45;quote">"scp://localhost/www/repository"</span>&#62;
    &#60;authentication username=<span class="java&#45;quote">"..."</span> privateKey=<span class="java&#45;quote">"&#36;&#123;user.home&#125;/.ssh/id_dsa"</span>/&#62;
&#60;/remoteRepository&#62;</pre></div><p class="paragraph"/>Can be expressed as:<p class="paragraph"/><div class="code"><pre>remoteRepository(id: <span class="java&#45;quote">"myRepo"</span>, url: <span class="java&#45;quote">"scp://localhost/www/repository"</span>) &#123;
    authentication username: <span class="java&#45;quote">"..."</span>, privateKey: <span class="java&#45;quote">"&#36;&#123;userHome&#125;/.ssh/id_dsa"</span>
&#125;</pre></div><p class="paragraph"/>By default the plugin will try to detect the protocol to use from the URL of the repository (ie "http" from "http://.." etc.), however to specify a different protocol you can do:<p class="paragraph"/><div class="code"><pre>grails maven&#45;deploy &#45;&#45;repository=myRepo &#45;&#45;protocol=webdav</pre></div><p class="paragraph"/>The available protocols are:
<ul class="star">
<li>http</li>
<li>scp</li>
<li>scpexe</li>
<li>ftp</li>
<li>webdav</li>
</ul><p class="paragraph"/><h4>Groups, Artifacts and Versions</h4><p class="paragraph"/>Maven defines the notion of a 'groupId', 'artifactId' and a 'version'. This plugin pulls this information from the Grails project conventions or plugin descriptor.<p class="paragraph"/><h5>Projects</h5><p class="paragraph"/>For applications this plugin will use the Grails application name and version provided by Grails when generating the <code>pom.xml</code> file. To change the version you can run the <code>set-version</code> command:<p class="paragraph"/><div class="code"><pre>grails set&#45;version 0.2</pre></div><p class="paragraph"/>The Maven <code>groupId</code> will be the same as the project name, unless you specify a different one in Config.groovy:<p class="paragraph"/><div class="code"><pre>grails.project.groupId=<span class="java&#45;quote">"com.mycompany"</span></pre></div><p class="paragraph"/><h5>Plugins</h5><p class="paragraph"/>With a Grails plugin the <code>groupId</code> and <code>version</code> are taken from the following properties in the <code>GrailsPlugin.groovy</code> descriptor:<p class="paragraph"/><div class="code"><pre><span class="java&#45;object">String</span> groupId = 'myOrg'
<span class="java&#45;object">String</span> version = '0.1'</pre></div><p class="paragraph"/>The 'artifactId' is taken from the plugin name. For example if you have a plugin called <code>FeedsGrailsPlugin</code> the <code>artifactId</code> will be "feeds". If your plugin does not specify a <code>groupId</code> then this defaults to "org.grails.plugins".


<a name="3.7.10 Plugin Dependencies"><!-- Legacy link --></a>
<h2 id="pluginDependencies">4.7.11 Plugin Dependencies</h2>
As of Grails 1.3 you can declaratively specify plugins as dependencies via the dependency DSL instead of using the <a href="../ref/Command Line/install-plugin.html" class="commandLine">install-plugin</a> command:<p class="paragraph"/><div class="code"><pre>grails.project.dependency.resolution = &#123;
    &#8230;
    repositories &#123;
        &#8230;
    &#125;<p class="paragraph"/>    plugins &#123;
        runtime ':hibernate:1.2.1'
    &#125;<p class="paragraph"/>    dependencies &#123;
        &#8230;
    &#125;
    &#8230;
&#125;</pre></div><p class="paragraph"/>If you don't specify a group id the default plugin group id of <code>org.grails.plugins</code> is used. You can specify to use the latest version of a particular plugin by using "latest.integration" as the version number:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime ':hibernate:latest.integration'
&#125;</pre></div><p class="paragraph"/><h4>Integration vs. Release</h4><p class="paragraph"/>The "latest.integration" version label will also include resolving snapshot versions. To not include snapshot versions then use the "latest.release" label:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime ':hibernate:latest.release'
&#125;</pre></div><p class="paragraph"/><blockquote class="note">
The "latest.release" label only works with Maven compatible repositories. If you have a regular SVN-based Grails repository then you should use "latest.integration".
</blockquote><p class="paragraph"/>And of course if you use a Maven repository with an alternative group id you can specify a group id:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime 'mycompany:hibernate:latest.integration'
&#125;</pre></div><p class="paragraph"/><h4>Plugin Exclusions</h4><p class="paragraph"/>You can control how plugins transitively resolves both plugin and JAR dependencies using exclusions. For example:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime(':weceem:0.8') &#123;
        excludes <span class="java&#45;quote">"searchable"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>Here we have defined a dependency on the "weceem" plugin which transitively depends on the "searchable" plugin. By using the <code>excludes</code> method you can tell Grails  <em class="italic">not</em>  to transitively install the searchable plugin. You can combine this technique to specify an alternative version of a plugin:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime(':weceem:0.8') &#123;
        excludes <span class="java&#45;quote">"searchable"</span> // excludes most recent version
    &#125;
    runtime ':searchable:0.5.4' // specifies a fixed searchable version
&#125;</pre></div><p class="paragraph"/>You can also completely disable transitive plugin installs, in which case no transitive dependencies will be resolved:<p class="paragraph"/><div class="code"><pre>plugins &#123;
    runtime(':weceem:0.8') &#123;
        transitive = <span class="java&#45;keyword">false</span>
    &#125;
    runtime ':searchable:0.5.4' // specifies a fixed searchable version
&#125;</pre></div>


<a name="3.7.12 Dependency Resolution Caching"><!-- Legacy link --></a>
<h2 id="dependencyResolutionCaching">4.7.12 Caching of Dependency Resolution Results</h2>
As a performance optimisation, Grails does not resolve dependencies for every command invocation. Even with all the necessary dependencies downloaded and cached, resolution may take a second or two. To minimise this cost, Grails caches the result of dependency resolution (i.e. the location on the local file system of all of the declared dependencies, typically inside the dependency cache) and reuses this result for subsequent commands when it can reasonably expect that nothing has changed.<p class="paragraph"/>Grails only performs dependency resolution under the following circumstances:
<ul class="star">
<li>The project is clean (i.e. fresh checkout or after <code>grails clean</code>)</li>
<li>The <code>BuildConfig.groovy</code> file has changed since the last command was run</li>
<li>The <code>&#45;&#45;refresh-dependencies</code> command line switch is provided to the command (any command)</li>
<li>The <code>refresh-dependencies</code> command is the command being executed</li>
</ul><p class="paragraph"/>Generally, this strategy works well and you can ignore dependency resolution caching. Every time you change your dependencies (i.e. modify <code>BuildConfig.groovy</code>) Grails will do the right thing and resolve your new dependencies.<p class="paragraph"/>However, when you have  <em class="italic">changing</em>  or  <em class="italic">dynamic</em>  dependencies you will have to consider dependency resolution caching.<p class="paragraph"/>{info}
A  <em class="italic">changing</em>  dependency is one whose version number does not change, but its contents do (like a SNAPSHOT). A  <em class="italic">dynamic</em>  dependency is one that is defined as one of many possible options (like a dependency with a version range, or symbolic version number like <code>latest.integration</code>).
{info}<p class="paragraph"/>Both  <em class="italic">changing</em>  and  <em class="italic">dynamic</em>  dependencies are influenced by the environment. With caching active, any changes to the environment are effectively ignored. For example, your project may not automatically fetch the very latest version of a dependency when using <code>latest.integration</code>. Or if you declare a <code>SNAPSHOT</code> dependency, you may not automatically get the latest that's available on the server.<p class="paragraph"/>To ensure you have the correct version of a  <em class="italic">changing</em>  or  <em class="italic">dynamic</em>  dependency in your project, you can:
<ul class="star">
<li>clean the project</li>
<li>run the <code>refresh-dependencies</code> command</li>
<li>run  <em class="italic">any</em>  command with the <code>&#45;&#45;refresh-dependencies</code> switch; or</li>
<li>make a change to <code>BuildConfig.groovy</code></li>
</ul><p class="paragraph"/>If you have your CI builds configured to not perform clean builds, it may be worth adding the <code>&#45;&#45;refresh-dependencies</code> switch to the command you use to build your projects.



                <div style="clear:both;margin-top:15px;"></div>
                
                    <div class="toc-item prev-left"><a href="../guide/upgradingFromPreviousVersionsOfGrails.html">&lt;&lt; <strong>3</strong><span>Upgrading from previous versions of Grails</span></a></div>
                
                    <div class="toc-item next-right"><a href="../guide/commandLine.html"><strong>5</strong><span>The Command Line</span> >></a></div>
                
                <div style="clear:both"></div>
            </div>
        </td>
        <td id="col2">
            <div class="local clearfix">
                <div class="local-title">
                    <a href="../guide/index.html" target="mainFrame">Quick Reference</a>
                    <span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
                </div>
                <div class="menu">
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Command Line</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Command%20Line/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/add-proxy.html">add-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/alias.html">alias</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/bootstrap.html">bootstrap</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/bug-report.html">bug-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/clean.html">clean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/clear-proxy.html">clear-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/compile.html">compile</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/console.html">console</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-app.html">create-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-controller.html">create-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-domain-class.html">create-domain-class</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-filters.html">create-filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-hibernate-cfg-xml.html">create-hibernate-cfg-xml</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-integration-test.html">create-integration-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-multi-project-build.html">create-multi-project-build</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-plugin.html">create-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-pom.html">create-pom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-scaffold-controller.html">create-scaffold-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-script.html">create-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-service.html">create-service</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-tag-lib.html">create-tag-lib</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/create-unit-test.html">create-unit-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/dependency-report.html">dependency-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/doc.html">doc</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-all.html">generate-all</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-controller.html">generate-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/generate-views.html">generate-views</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/help.html">help</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/init.html">init</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/install-dependency.html">install-dependency</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/install-plugin.html">install-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/install-templates.html">install-templates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/integrate-with.html">integrate-with</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/interactive.html">interactive</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/list-plugin-updates.html">list-plugin-updates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/list-plugins.html">list-plugins</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/migrate-docs.html">migrate-docs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/package-plugin.html">package-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/package.html">package</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/plugin-info.html">plugin-info</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/refresh-dependencies.html">refresh-dependencies</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/remove-proxy.html">remove-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-app.html">run-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-script.html">run-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/run-war.html">run-war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/schema-export.html">schema-export</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/set-proxy.html">set-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/set-version.html">set-version</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/shell.html">shell</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/stats.html">stats</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/stop-app.html">stop-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/test-app.html">test-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/uninstall-plugin.html">uninstall-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/upgrade.html">upgrade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/war.html">war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Command%20Line/wrapper.html">wrapper</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Constraints</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Constraints/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Constraints/attributes.html">attributes</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/bindable.html">bindable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/blank.html">blank</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/creditCard.html">creditCard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/email.html">email</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/inList.html">inList</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/matches.html">matches</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/max.html">max</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/maxSize.html">maxSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/min.html">min</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/minSize.html">minSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/notEqual.html">notEqual</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/nullable.html">nullable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/range.html">range</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/scale.html">scale</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/size.html">size</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/unique.html">unique</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/url.html">url</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/validator.html">validator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Constraints/widget.html">widget</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Controllers</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Controllers/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Controllers/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/afterInterceptor.html">afterInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/allowedMethods.html">allowedMethods</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/beforeInterceptor.html">beforeInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/bindData.html">bindData</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/chain.html">chain</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/defaultAction.html">defaultAction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/forward.html">forward</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/grailsApplication.html">grailsApplication</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/redirect.html">redirect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/session.html">session</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/withForm.html">withForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Controllers/withFormat.html">withFormat</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Database Mapping</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Database%20Mapping/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/autoImport.html">autoImport</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/autoTimestamp.html">autoTimestamp</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/batchSize.html">batchSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/cache.html">cache</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/cascade.html">cascade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/column.html">column</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/comment.html">comment</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/discriminator.html">discriminator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/dynamicInsert.html">dynamicInsert</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/dynamicUpdate.html">dynamicUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/fetch.html">fetch</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/id.html">id</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/ignoreNotFound.html">ignoreNotFound</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/indexColumn.html">indexColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/insertable.html">insertable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/joinTable.html">joinTable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/lazy.html">lazy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/order.html">order</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/sort.html">sort</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/table.html">table</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/type.html">type</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/updateable.html">updateable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Database%20Mapping/version.html">version</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Domain Classes</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Domain%20Classes/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/addTo.html">addTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/attach.html">attach</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/belongsTo.html">belongsTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/clearErrors.html">clearErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/constraints.html">constraints</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/count.html">count</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/countBy.html">countBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/createCriteria.html">createCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/delete.html">delete</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/discard.html">discard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/embedded.html">embedded</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/errors.html">errors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/executeQuery.html">executeQuery</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/executeUpdate.html">executeUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/exists.html">exists</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/fetchMode.html">fetchMode</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/find.html">find</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAllBy.html">findAllBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findAllWhere.html">findAllWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findBy.html">findBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateBy.html">findOrCreateBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateWhere.html">findOrCreateWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveBy.html">findOrSaveBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveWhere.html">findOrSaveWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/findWhere.html">findWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/first.html">first</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/get.html">get</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getAll.html">getAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getDirtyPropertyNames.html">getDirtyPropertyNames</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/getPersistentValue.html">getPersistentValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasMany.html">hasMany</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/hasOne.html">hasOne</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/ident.html">ident</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/instanceOf.html">instanceOf</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/isAttached.html">isAttached</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/isDirty.html">isDirty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/last.html">last</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/list.html">list</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/listOrderBy.html">listOrderBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/load.html">load</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/lock.html">lock</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/mappedBy.html">mappedBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/mapping.html">mapping</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/merge.html">merge</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/namedQueries.html">namedQueries</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/properties.html">properties</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/read.html">read</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/refresh.html">refresh</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/removeFrom.html">removeFrom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/save.html">save</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/transients.html">transients</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/validate.html">validate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/where.html">where</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/whereAny.html">whereAny</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withCriteria.html">withCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withNewSession.html">withNewSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withSession.html">withSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Domain%20Classes/withTransaction.html">withTransaction</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Plug-ins</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Plug-ins/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/URL%20mappings.html">URL mappings</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/codecs.html">codecs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/controllers.html">controllers</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/core.html">core</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/dataSource.html">dataSource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/domainClasses.html">domainClasses</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/filters.html">filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/hibernate.html">hibernate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/i18n.html">i18n</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/logging.html">logging</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/scaffolding.html">scaffolding</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/services.html">services</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/servlets.html">servlets</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Plug-ins/web%20flow.html">web flow</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Services</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Services/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Services/scope.html">scope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Services/transactional.html">transactional</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Servlet API</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Servlet%20API/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tag Libraries</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/pageScope.html">pageScope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tag%20Libraries/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tags</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../ref/Tags/actionSubmit.html">actionSubmit</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/actionSubmitImage.html">actionSubmitImage</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/applyLayout.html">applyLayout</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/checkBox.html">checkBox</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/collect.html">collect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/cookie.html">cookie</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/country.html">country</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/countrySelect.html">countrySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/createLink.html">createLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/createLinkTo.html">createLinkTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/currencySelect.html">currencySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/datePicker.html">datePicker</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/each.html">each</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/eachError.html">eachError</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/else.html">else</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/elseif.html">elseif</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/external.html">external</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/field.html">field</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/fieldValue.html">fieldValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/form.html">form</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formRemote.html">formRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatBoolean.html">formatBoolean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatDate.html">formatDate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/formatNumber.html">formatNumber</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/grep.html">grep</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/header.html">header</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/hiddenField.html">hiddenField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/if.html">if</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/img.html">img</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/include.html">include</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/isAvailable.html">isAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/isNotAvailable.html">isNotAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/javascript.html">javascript</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/join.html">join</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutBody.html">layoutBody</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutHead.html">layoutHead</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/layoutTitle.html">layoutTitle</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/link.html">link</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/localeSelect.html">localeSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/message.html">message</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/meta.html">meta</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/pageProperty.html">pageProperty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/paginate.html">paginate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/passwordField.html">passwordField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/radio.html">radio</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/radioGroup.html">radioGroup</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/remoteField.html">remoteField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/remoteFunction.html">remoteFunction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/remoteLink.html">remoteLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/renderErrors.html">renderErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/resource.html">resource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/select.html">select</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/set.html">set</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/setProvider.html">setProvider</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/sortableColumn.html">sortableColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/submitButton.html">submitButton</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/submitToRemote.html">submitToRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/textArea.html">textArea</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/textField.html">textField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/timeZoneSelect.html">timeZoneSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/unless.html">unless</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/uploadForm.html">uploadForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../ref/Tags/while.html">while</a>
                            </div>
                            
                            </div>
                    </div>
                    
                </div>
            </div>
        </td>
    </tr>
</table>

<div id="footer">
    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
    Sponsored by <a href="http://springsource.com">SpringSource</a>
</div>

<script type="text/javascript" src="../js/docs.js"></script>

</body>
</html>
